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