xref: /illumos-gate/usr/src/uts/common/fs/zfs/sys/zil.h (revision 569e6c63191416b7413c148fd5a6194a0b820b2c)
1fa9e4066Sahrens /*
2fa9e4066Sahrens  * CDDL HEADER START
3fa9e4066Sahrens  *
4fa9e4066Sahrens  * The contents of this file are subject to the terms of the
5436b2950Sperrin  * Common Development and Distribution License (the "License").
6436b2950Sperrin  * You may not use this file except in compliance with the License.
7fa9e4066Sahrens  *
8fa9e4066Sahrens  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fa9e4066Sahrens  * or http://www.opensolaris.org/os/licensing.
10fa9e4066Sahrens  * See the License for the specific language governing permissions
11fa9e4066Sahrens  * and limitations under the License.
12fa9e4066Sahrens  *
13fa9e4066Sahrens  * When distributing Covered Code, include this CDDL HEADER in each
14fa9e4066Sahrens  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fa9e4066Sahrens  * If applicable, add the following below this CDDL HEADER, with the
16fa9e4066Sahrens  * fields enclosed by brackets "[]" replaced with your own identifying
17fa9e4066Sahrens  * information: Portions Copyright [yyyy] [name of copyright owner]
18fa9e4066Sahrens  *
19fa9e4066Sahrens  * CDDL HEADER END
20fa9e4066Sahrens  */
21fa9e4066Sahrens /*
22893a6d32Sahrens  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
23fa9e4066Sahrens  * Use is subject to license terms.
24fa9e4066Sahrens  */
25fa9e4066Sahrens 
26fa9e4066Sahrens #ifndef	_SYS_ZIL_H
27fa9e4066Sahrens #define	_SYS_ZIL_H
28fa9e4066Sahrens 
29fa9e4066Sahrens #pragma ident	"%Z%%M%	%I%	%E% SMI"
30fa9e4066Sahrens 
31fa9e4066Sahrens #include <sys/types.h>
32fa9e4066Sahrens #include <sys/spa.h>
33fa9e4066Sahrens #include <sys/zio.h>
34fa9e4066Sahrens #include <sys/dmu.h>
35fa9e4066Sahrens 
36fa9e4066Sahrens #ifdef	__cplusplus
37fa9e4066Sahrens extern "C" {
38fa9e4066Sahrens #endif
39fa9e4066Sahrens 
40fa9e4066Sahrens /*
41fa9e4066Sahrens  * Intent log format:
42fa9e4066Sahrens  *
43fa9e4066Sahrens  * Each objset has its own intent log.  The log header (zil_header_t)
44fa9e4066Sahrens  * for objset N's intent log is kept in the Nth object of the SPA's
45fa9e4066Sahrens  * intent_log objset.  The log header points to a chain of log blocks,
46fa9e4066Sahrens  * each of which contains log records (i.e., transactions) followed by
47fa9e4066Sahrens  * a log block trailer (zil_trailer_t).  The format of a log record
48fa9e4066Sahrens  * depends on the record (or transaction) type, but all records begin
49fa9e4066Sahrens  * with a common structure that defines the type, length, and txg.
50fa9e4066Sahrens  */
51fa9e4066Sahrens 
52fa9e4066Sahrens /*
53fa9e4066Sahrens  * Intent log header - this on disk structure holds fields to manage
54fa9e4066Sahrens  * the log.  All fields are 64 bit to easily handle cross architectures.
55fa9e4066Sahrens  */
56fa9e4066Sahrens typedef struct zil_header {
57fa9e4066Sahrens 	uint64_t zh_claim_txg;	/* txg in which log blocks were claimed */
58fa9e4066Sahrens 	uint64_t zh_replay_seq;	/* highest replayed sequence number */
59fa9e4066Sahrens 	blkptr_t zh_log;	/* log chain */
60d80c45e0Sbonwick 	uint64_t zh_claim_seq;	/* highest claimed sequence number */
61d80c45e0Sbonwick 	uint64_t zh_pad[5];
62fa9e4066Sahrens } zil_header_t;
63fa9e4066Sahrens 
64fa9e4066Sahrens /*
65fa9e4066Sahrens  * Log block trailer - structure at the end of the header and each log block
66fa9e4066Sahrens  *
67fa9e4066Sahrens  * The zit_bt contains a zbt_cksum which for the intent log is
68fa9e4066Sahrens  * the sequence number of this log block. A seq of 0 is invalid.
69fa9e4066Sahrens  * The zbt_cksum is checked by the SPA against the sequence
70fa9e4066Sahrens  * number passed in the blk_cksum field of the blkptr_t
71fa9e4066Sahrens  */
72fa9e4066Sahrens typedef struct zil_trailer {
73fa9e4066Sahrens 	uint64_t zit_pad;
74fa9e4066Sahrens 	blkptr_t zit_next_blk;	/* next block in chain */
75fa9e4066Sahrens 	uint64_t zit_nused;	/* bytes in log block used */
76fa9e4066Sahrens 	zio_block_tail_t zit_bt; /* block trailer */
77fa9e4066Sahrens } zil_trailer_t;
78fa9e4066Sahrens 
79b4d654b0Sperrin #define	ZIL_MIN_BLKSZ	4096ULL
80fa9e4066Sahrens #define	ZIL_MAX_BLKSZ	SPA_MAXBLOCKSIZE
81fa9e4066Sahrens #define	ZIL_BLK_DATA_SZ(lwb)	((lwb)->lwb_sz - sizeof (zil_trailer_t))
82fa9e4066Sahrens 
83d80c45e0Sbonwick /*
84d80c45e0Sbonwick  * The words of a log block checksum.
85d80c45e0Sbonwick  */
86d80c45e0Sbonwick #define	ZIL_ZC_GUID_0	0
87d80c45e0Sbonwick #define	ZIL_ZC_GUID_1	1
88d80c45e0Sbonwick #define	ZIL_ZC_OBJSET	2
89d80c45e0Sbonwick #define	ZIL_ZC_SEQ	3
90d80c45e0Sbonwick 
91da6c28aaSamw typedef enum zil_create {
92da6c28aaSamw 	Z_FILE,
93da6c28aaSamw 	Z_DIR,
94da6c28aaSamw 	Z_XATTRDIR,
95da6c28aaSamw } zil_create_t;
96da6c28aaSamw 
97da6c28aaSamw /*
98da6c28aaSamw  * size of xvattr log section.
99da6c28aaSamw  * its composed of lr_attr_t + xvattr bitmap + 2 64 bit timestamps
100da6c28aaSamw  * for create time and a single 64 bit integer for all of the attributes,
101da6c28aaSamw  * and 4 64 bit integers (32 bytes) for the scanstamp.
102da6c28aaSamw  *
103da6c28aaSamw  */
104da6c28aaSamw 
105da6c28aaSamw #define	ZIL_XVAT_SIZE(mapsize) \
106da6c28aaSamw 	sizeof (lr_attr_t) + (sizeof (uint32_t) * (mapsize - 1)) + \
107da6c28aaSamw 	(sizeof (uint64_t) * 7)
108*569e6c63Smarks 
109*569e6c63Smarks /*
110*569e6c63Smarks  * Size of ACL in log.  The ACE data is padded out to properly align
111*569e6c63Smarks  * on 8 byte boundary.
112*569e6c63Smarks  */
113*569e6c63Smarks 
114*569e6c63Smarks #define	ZIL_ACE_LENGTH(x)	(roundup(x, sizeof (uint64_t)))
115*569e6c63Smarks 
116fa9e4066Sahrens /*
117fa9e4066Sahrens  * Intent log transaction types and record structures
118fa9e4066Sahrens  */
119da6c28aaSamw #define	TX_CREATE		1	/* Create file */
120da6c28aaSamw #define	TX_MKDIR		2	/* Make directory */
121da6c28aaSamw #define	TX_MKXATTR		3	/* Make XATTR directory */
122da6c28aaSamw #define	TX_SYMLINK		4	/* Create symbolic link to a file */
123da6c28aaSamw #define	TX_REMOVE		5	/* Remove file */
124da6c28aaSamw #define	TX_RMDIR		6	/* Remove directory */
125da6c28aaSamw #define	TX_LINK			7	/* Create hard link to a file */
126da6c28aaSamw #define	TX_RENAME		8	/* Rename a file */
127da6c28aaSamw #define	TX_WRITE		9	/* File write */
128da6c28aaSamw #define	TX_TRUNCATE		10	/* Truncate a file */
129da6c28aaSamw #define	TX_SETATTR		11	/* Set file attributes */
130da6c28aaSamw #define	TX_ACL_V0		12	/* Set old formatted ACL */
131da6c28aaSamw #define	TX_ACL			13	/* Set ACL */
132da6c28aaSamw #define	TX_CREATE_ACL		14	/* create with ACL */
133da6c28aaSamw #define	TX_CREATE_ATTR		15	/* create + attrs */
134da6c28aaSamw #define	TX_CREATE_ACL_ATTR 	16	/* create with ACL + attrs */
135da6c28aaSamw #define	TX_MKDIR_ACL		17	/* mkdir with ACL */
136da6c28aaSamw #define	TX_MKDIR_ATTR		18	/* mkdir with attr */
137da6c28aaSamw #define	TX_MKDIR_ACL_ATTR	19	/* mkdir with ACL + attrs */
138da6c28aaSamw #define	TX_MAX_TYPE		20	/* Max transaction type */
139da6c28aaSamw 
140da6c28aaSamw /*
141da6c28aaSamw  * The transactions for mkdir, symlink, remove, rmdir, link, and rename
142da6c28aaSamw  * may have the following bit set, indicating the original request
143da6c28aaSamw  * specified case-insensitive handling of names.
144da6c28aaSamw  */
145da6c28aaSamw #define	TX_CI	((uint64_t)0x1 << 63) /* case-insensitive behavior requested */
146fa9e4066Sahrens 
147fa9e4066Sahrens /*
148fa9e4066Sahrens  * Format of log records.
149fa9e4066Sahrens  * The fields are carefully defined to allow them to be aligned
150fa9e4066Sahrens  * and sized the same on sparc & intel architectures.
151fa9e4066Sahrens  * Each log record has a common structure at the beginning.
152b19a79ecSperrin  *
153b19a79ecSperrin  * Note, lrc_seq holds two different sequence numbers. Whilst in memory
154b19a79ecSperrin  * it contains the transaction sequence number.  The log record on
155b19a79ecSperrin  * disk holds the sequence number of all log records which is used to
156b19a79ecSperrin  * ensure we don't replay the same record.  The two sequence numbers are
157b19a79ecSperrin  * different because the transactions can now be pushed out of order.
158fa9e4066Sahrens  */
159fa9e4066Sahrens typedef struct {			/* common log record header */
160fa9e4066Sahrens 	uint64_t	lrc_txtype;	/* intent log transaction type */
161fa9e4066Sahrens 	uint64_t	lrc_reclen;	/* transaction record length */
162fa9e4066Sahrens 	uint64_t	lrc_txg;	/* dmu transaction group number */
163b19a79ecSperrin 	uint64_t	lrc_seq;	/* see comment above */
164fa9e4066Sahrens } lr_t;
165fa9e4066Sahrens 
166da6c28aaSamw /*
167da6c28aaSamw  * Handle option extended vattr attributes.
168da6c28aaSamw  *
169da6c28aaSamw  * Whenever new attributes are added the version number
170da6c28aaSamw  * will need to be updated as will code in
171da6c28aaSamw  * zfs_log.c and zfs_replay.c
172da6c28aaSamw  */
173da6c28aaSamw typedef struct {
174da6c28aaSamw 	uint32_t	lr_attr_masksize; /* number of elements in array */
175da6c28aaSamw 	uint32_t	lr_attr_bitmap; /* First entry of array */
176da6c28aaSamw 	/* remainder of array and any additional fields */
177da6c28aaSamw } lr_attr_t;
178da6c28aaSamw 
179da6c28aaSamw /*
180da6c28aaSamw  * log record for creates without optional ACL.
181da6c28aaSamw  * This log record does support optional xvattr_t attributes.
182da6c28aaSamw  */
183fa9e4066Sahrens typedef struct {
184fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
185fa9e4066Sahrens 	uint64_t	lr_doid;	/* object id of directory */
186fa9e4066Sahrens 	uint64_t	lr_foid;	/* object id of created file object */
187fa9e4066Sahrens 	uint64_t	lr_mode;	/* mode of object */
188fa9e4066Sahrens 	uint64_t	lr_uid;		/* uid of object */
189fa9e4066Sahrens 	uint64_t	lr_gid;		/* gid of object */
190fa9e4066Sahrens 	uint64_t	lr_gen;		/* generation (txg of creation) */
191fa9e4066Sahrens 	uint64_t	lr_crtime[2];	/* creation time */
192fa9e4066Sahrens 	uint64_t	lr_rdev;	/* rdev of object to create */
193fa9e4066Sahrens 	/* name of object to create follows this */
194fa9e4066Sahrens 	/* for symlinks, link content follows name */
195da6c28aaSamw 	/* for creates with xvattr data, the name follows the xvattr info */
196fa9e4066Sahrens } lr_create_t;
197fa9e4066Sahrens 
198da6c28aaSamw /*
199da6c28aaSamw  * FUID ACL record will be an array of ACEs from the original ACL.
200da6c28aaSamw  * If this array includes ephemeral IDs, the record will also include
201da6c28aaSamw  * an array of log-specific FUIDs to replace the ephemeral IDs.
202da6c28aaSamw  * Only one copy of each unique domain will be present, so the log-specific
203da6c28aaSamw  * FUIDs will use an index into a compressed domain table.  On replay this
204da6c28aaSamw  * information will be used to construct real FUIDs (and bypass idmap,
205da6c28aaSamw  * since it may not be available).
206da6c28aaSamw  */
207da6c28aaSamw 
208da6c28aaSamw /*
209da6c28aaSamw  * Log record for creates with optional ACL
210da6c28aaSamw  * This log record is also used for recording any FUID
211da6c28aaSamw  * information needed for replaying the create.  If the
212da6c28aaSamw  * file doesn't have any actual ACEs then the lr_aclcnt
213da6c28aaSamw  * would be zero.
214da6c28aaSamw  */
215da6c28aaSamw typedef struct {
216da6c28aaSamw 	lr_create_t	lr_create;	/* common create portion */
217da6c28aaSamw 	uint64_t	lr_aclcnt;	/* number of ACEs in ACL */
218da6c28aaSamw 	uint64_t	lr_domcnt;	/* number of unique domains */
219da6c28aaSamw 	uint64_t	lr_fuidcnt;	/* number of real fuids */
220da6c28aaSamw 	uint64_t	lr_acl_bytes;	/* number of bytes in ACL */
221da6c28aaSamw 	uint64_t	lr_acl_flags;	/* ACL flags */
222da6c28aaSamw 	/* lr_acl_bytes number of variable sized ace's follows */
223da6c28aaSamw 	/* if create is also setting xvattr's, then acl data follows xvattr */
224da6c28aaSamw 	/* if ACE FUIDs are needed then they will follow the xvattr_t */
225da6c28aaSamw 	/* Following the FUIDs will be the domain table information. */
226da6c28aaSamw 	/* The FUIDs for the owner and group will be in the lr_create */
227da6c28aaSamw 	/* portion of the record. */
228da6c28aaSamw 	/* name follows ACL data */
229da6c28aaSamw } lr_acl_create_t;
230da6c28aaSamw 
231fa9e4066Sahrens typedef struct {
232fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
233fa9e4066Sahrens 	uint64_t	lr_doid;	/* obj id of directory */
234fa9e4066Sahrens 	/* name of object to remove follows this */
235fa9e4066Sahrens } lr_remove_t;
236fa9e4066Sahrens 
237fa9e4066Sahrens typedef struct {
238fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
239fa9e4066Sahrens 	uint64_t	lr_doid;	/* obj id of directory */
240fa9e4066Sahrens 	uint64_t	lr_link_obj;	/* obj id of link */
241fa9e4066Sahrens 	/* name of object to link follows this */
242fa9e4066Sahrens } lr_link_t;
243fa9e4066Sahrens 
244fa9e4066Sahrens typedef struct {
245fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
246fa9e4066Sahrens 	uint64_t	lr_sdoid;	/* obj id of source directory */
247fa9e4066Sahrens 	uint64_t	lr_tdoid;	/* obj id of target directory */
248fa9e4066Sahrens 	/* 2 strings: names of source and destination follow this */
249fa9e4066Sahrens } lr_rename_t;
250fa9e4066Sahrens 
251fa9e4066Sahrens typedef struct {
252fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
253fa9e4066Sahrens 	uint64_t	lr_foid;	/* file object to write */
254fa9e4066Sahrens 	uint64_t	lr_offset;	/* offset to write to */
255fa9e4066Sahrens 	uint64_t	lr_length;	/* user data length to write */
256fa9e4066Sahrens 	uint64_t	lr_blkoff;	/* offset represented by lr_blkptr */
257fa9e4066Sahrens 	blkptr_t	lr_blkptr;	/* spa block pointer for replay */
258fa9e4066Sahrens 	/* write data will follow for small writes */
259fa9e4066Sahrens } lr_write_t;
260fa9e4066Sahrens 
261fa9e4066Sahrens typedef struct {
262fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
263fa9e4066Sahrens 	uint64_t	lr_foid;	/* object id of file to truncate */
264fa9e4066Sahrens 	uint64_t	lr_offset;	/* offset to truncate from */
265fa9e4066Sahrens 	uint64_t	lr_length;	/* length to truncate */
266fa9e4066Sahrens } lr_truncate_t;
267fa9e4066Sahrens 
268fa9e4066Sahrens typedef struct {
269fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
270fa9e4066Sahrens 	uint64_t	lr_foid;	/* file object to change attributes */
271fa9e4066Sahrens 	uint64_t	lr_mask;	/* mask of attributes to set */
272fa9e4066Sahrens 	uint64_t	lr_mode;	/* mode to set */
273fa9e4066Sahrens 	uint64_t	lr_uid;		/* uid to set */
274fa9e4066Sahrens 	uint64_t	lr_gid;		/* gid to set */
275fa9e4066Sahrens 	uint64_t	lr_size;	/* size to set */
276fa9e4066Sahrens 	uint64_t	lr_atime[2];	/* access time */
277fa9e4066Sahrens 	uint64_t	lr_mtime[2];	/* modification time */
278da6c28aaSamw 	/* optional attribute lr_attr_t may be here */
279fa9e4066Sahrens } lr_setattr_t;
280fa9e4066Sahrens 
281fa9e4066Sahrens typedef struct {
282fa9e4066Sahrens 	lr_t		lr_common;	/* common portion of log record */
283fa9e4066Sahrens 	uint64_t	lr_foid;	/* obj id of file */
284fa9e4066Sahrens 	uint64_t	lr_aclcnt;	/* number of acl entries */
285fa9e4066Sahrens 	/* lr_aclcnt number of ace_t entries follow this */
286da6c28aaSamw } lr_acl_v0_t;
287da6c28aaSamw 
288da6c28aaSamw typedef struct {
289da6c28aaSamw 	lr_t		lr_common;	/* common portion of log record */
290da6c28aaSamw 	uint64_t	lr_foid;	/* obj id of file */
291da6c28aaSamw 	uint64_t	lr_aclcnt;	/* number of ACEs in ACL */
292da6c28aaSamw 	uint64_t	lr_domcnt;	/* number of unique domains */
293da6c28aaSamw 	uint64_t	lr_fuidcnt;	/* number of real fuids */
294da6c28aaSamw 	uint64_t	lr_acl_bytes;	/* number of bytes in ACL */
295da6c28aaSamw 	uint64_t	lr_acl_flags;	/* ACL flags */
296da6c28aaSamw 	/* lr_acl_bytes number of variable sized ace's follows */
297fa9e4066Sahrens } lr_acl_t;
298fa9e4066Sahrens 
299fa9e4066Sahrens /*
300fa9e4066Sahrens  * ZIL structure definitions, interface function prototype and globals.
301fa9e4066Sahrens  */
302fa9e4066Sahrens 
303fa9e4066Sahrens /*
304fa9e4066Sahrens  * ZFS intent log transaction structure
305fa9e4066Sahrens  */
306104e2ed7Sperrin typedef enum {
307104e2ed7Sperrin 	WR_INDIRECT,	/* indirect - a large write (dmu_sync() data */
308104e2ed7Sperrin 			/* and put blkptr in log, rather than actual data) */
309104e2ed7Sperrin 	WR_COPIED,	/* immediate - data is copied into lr_write_t */
310104e2ed7Sperrin 	WR_NEED_COPY,	/* immediate - data needs to be copied if pushed */
311104e2ed7Sperrin } itx_wr_state_t;
312104e2ed7Sperrin 
313fa9e4066Sahrens typedef struct itx {
314fa9e4066Sahrens 	list_node_t	itx_node;	/* linkage on zl_itx_list */
315fa9e4066Sahrens 	void		*itx_private;	/* type-specific opaque data */
316104e2ed7Sperrin 	itx_wr_state_t	itx_wr_state;	/* write state */
31767bd71c6Sperrin 	uint8_t		itx_sync;	/* synchronous transaction */
318fa9e4066Sahrens 	lr_t		itx_lr;		/* common part of log record */
319fa9e4066Sahrens 	/* followed by type-specific part of lr_xx_t and its immediate data */
320fa9e4066Sahrens } itx_t;
321fa9e4066Sahrens 
32267bd71c6Sperrin 
32367bd71c6Sperrin /*
32467bd71c6Sperrin  * zgd_t is passed through dmu_sync() to the callback routine zfs_get_done()
32567bd71c6Sperrin  * to handle the cleanup of the dmu_sync() buffer write
32667bd71c6Sperrin  */
32767bd71c6Sperrin typedef struct {
32867bd71c6Sperrin 	zilog_t		*zgd_zilog;	/* zilog */
32967bd71c6Sperrin 	blkptr_t	*zgd_bp;	/* block pointer */
33067bd71c6Sperrin 	struct rl	*zgd_rl;	/* range lock */
33167bd71c6Sperrin } zgd_t;
33267bd71c6Sperrin 
33367bd71c6Sperrin 
334fa9e4066Sahrens typedef void zil_parse_blk_func_t(zilog_t *zilog, blkptr_t *bp, void *arg,
335fa9e4066Sahrens     uint64_t txg);
336fa9e4066Sahrens typedef void zil_parse_lr_func_t(zilog_t *zilog, lr_t *lr, void *arg,
337fa9e4066Sahrens     uint64_t txg);
338fa9e4066Sahrens typedef int zil_replay_func_t();
339c5c6ffa0Smaybee typedef int zil_get_data_t(void *arg, lr_write_t *lr, char *dbuf, zio_t *zio);
340fa9e4066Sahrens 
341d80c45e0Sbonwick extern uint64_t	zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func,
342fa9e4066Sahrens     zil_parse_lr_func_t *parse_lr_func, void *arg, uint64_t txg);
343fa9e4066Sahrens 
344fa9e4066Sahrens extern void	zil_init(void);
345fa9e4066Sahrens extern void	zil_fini(void);
346fa9e4066Sahrens 
347fa9e4066Sahrens extern zilog_t	*zil_alloc(objset_t *os, zil_header_t *zh_phys);
348fa9e4066Sahrens extern void	zil_free(zilog_t *zilog);
349fa9e4066Sahrens 
350fa9e4066Sahrens extern zilog_t	*zil_open(objset_t *os, zil_get_data_t *get_data);
351fa9e4066Sahrens extern void	zil_close(zilog_t *zilog);
352fa9e4066Sahrens 
353fa9e4066Sahrens extern void	zil_replay(objset_t *os, void *arg, uint64_t *txgp,
354893a6d32Sahrens     zil_replay_func_t *replay_func[TX_MAX_TYPE]);
355d80c45e0Sbonwick extern void	zil_destroy(zilog_t *zilog, boolean_t keep_first);
3563a8a1de4Sperrin extern void	zil_rollback_destroy(zilog_t *zilog, dmu_tx_t *tx);
357fa9e4066Sahrens 
358da6c28aaSamw extern itx_t	*zil_itx_create(uint64_t txtype, size_t lrsize);
359fa9e4066Sahrens extern uint64_t zil_itx_assign(zilog_t *zilog, itx_t *itx, dmu_tx_t *tx);
360fa9e4066Sahrens 
361b19a79ecSperrin extern void	zil_commit(zilog_t *zilog, uint64_t seq, uint64_t oid);
362fa9e4066Sahrens 
3631d452cf5Sahrens extern int	zil_claim(char *osname, void *txarg);
364fa9e4066Sahrens extern void	zil_sync(zilog_t *zilog, dmu_tx_t *tx);
365fa9e4066Sahrens extern void	zil_clean(zilog_t *zilog);
366436b2950Sperrin extern int	zil_is_committed(zilog_t *zilog);
367fa9e4066Sahrens 
368fa9e4066Sahrens extern int	zil_suspend(zilog_t *zilog);
369fa9e4066Sahrens extern void	zil_resume(zilog_t *zilog);
370fa9e4066Sahrens 
37167bd71c6Sperrin extern void	zil_add_vdev(zilog_t *zilog, uint64_t vdev);
37267bd71c6Sperrin 
373fa9e4066Sahrens extern int zil_disable;
374fa9e4066Sahrens 
375fa9e4066Sahrens #ifdef	__cplusplus
376fa9e4066Sahrens }
377fa9e4066Sahrens #endif
378fa9e4066Sahrens 
379fa9e4066Sahrens #endif	/* _SYS_ZIL_H */
380