diff options
-rw-r--r-- | fs/xfs/xfs_log_format.h | 206 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_trans.h | 205 |
3 files changed, 208 insertions, 207 deletions
diff --git a/fs/xfs/xfs_log_format.h b/fs/xfs/xfs_log_format.h index 02639c7ea404..faf3f4349a75 100644 --- a/fs/xfs/xfs_log_format.h +++ b/fs/xfs/xfs_log_format.h | |||
@@ -187,6 +187,212 @@ typedef struct xfs_log_iovec { | |||
187 | 187 | ||
188 | 188 | ||
189 | /* | 189 | /* |
190 | * Transaction Header definitions. | ||
191 | * | ||
192 | * This is the structure written in the log at the head of every transaction. It | ||
193 | * identifies the type and id of the transaction, and contains the number of | ||
194 | * items logged by the transaction so we know how many to expect during | ||
195 | * recovery. | ||
196 | * | ||
197 | * Do not change the below structure without redoing the code in | ||
198 | * xlog_recover_add_to_trans() and xlog_recover_add_to_cont_trans(). | ||
199 | */ | ||
200 | typedef struct xfs_trans_header { | ||
201 | uint th_magic; /* magic number */ | ||
202 | uint th_type; /* transaction type */ | ||
203 | __int32_t th_tid; /* transaction id (unused) */ | ||
204 | uint th_num_items; /* num items logged by trans */ | ||
205 | } xfs_trans_header_t; | ||
206 | |||
207 | #define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */ | ||
208 | |||
209 | /* | ||
210 | * Log item types. | ||
211 | */ | ||
212 | #define XFS_LI_EFI 0x1236 | ||
213 | #define XFS_LI_EFD 0x1237 | ||
214 | #define XFS_LI_IUNLINK 0x1238 | ||
215 | #define XFS_LI_INODE 0x123b /* aligned ino chunks, var-size ibufs */ | ||
216 | #define XFS_LI_BUF 0x123c /* v2 bufs, variable sized inode bufs */ | ||
217 | #define XFS_LI_DQUOT 0x123d | ||
218 | #define XFS_LI_QUOTAOFF 0x123e | ||
219 | #define XFS_LI_ICREATE 0x123f | ||
220 | |||
221 | #define XFS_LI_TYPE_DESC \ | ||
222 | { XFS_LI_EFI, "XFS_LI_EFI" }, \ | ||
223 | { XFS_LI_EFD, "XFS_LI_EFD" }, \ | ||
224 | { XFS_LI_IUNLINK, "XFS_LI_IUNLINK" }, \ | ||
225 | { XFS_LI_INODE, "XFS_LI_INODE" }, \ | ||
226 | { XFS_LI_BUF, "XFS_LI_BUF" }, \ | ||
227 | { XFS_LI_DQUOT, "XFS_LI_DQUOT" }, \ | ||
228 | { XFS_LI_QUOTAOFF, "XFS_LI_QUOTAOFF" }, \ | ||
229 | { XFS_LI_ICREATE, "XFS_LI_ICREATE" } | ||
230 | |||
231 | /* | ||
232 | * Transaction types. Used to distinguish types of buffers. | ||
233 | */ | ||
234 | #define XFS_TRANS_SETATTR_NOT_SIZE 1 | ||
235 | #define XFS_TRANS_SETATTR_SIZE 2 | ||
236 | #define XFS_TRANS_INACTIVE 3 | ||
237 | #define XFS_TRANS_CREATE 4 | ||
238 | #define XFS_TRANS_CREATE_TRUNC 5 | ||
239 | #define XFS_TRANS_TRUNCATE_FILE 6 | ||
240 | #define XFS_TRANS_REMOVE 7 | ||
241 | #define XFS_TRANS_LINK 8 | ||
242 | #define XFS_TRANS_RENAME 9 | ||
243 | #define XFS_TRANS_MKDIR 10 | ||
244 | #define XFS_TRANS_RMDIR 11 | ||
245 | #define XFS_TRANS_SYMLINK 12 | ||
246 | #define XFS_TRANS_SET_DMATTRS 13 | ||
247 | #define XFS_TRANS_GROWFS 14 | ||
248 | #define XFS_TRANS_STRAT_WRITE 15 | ||
249 | #define XFS_TRANS_DIOSTRAT 16 | ||
250 | /* 17 was XFS_TRANS_WRITE_SYNC */ | ||
251 | #define XFS_TRANS_WRITEID 18 | ||
252 | #define XFS_TRANS_ADDAFORK 19 | ||
253 | #define XFS_TRANS_ATTRINVAL 20 | ||
254 | #define XFS_TRANS_ATRUNCATE 21 | ||
255 | #define XFS_TRANS_ATTR_SET 22 | ||
256 | #define XFS_TRANS_ATTR_RM 23 | ||
257 | #define XFS_TRANS_ATTR_FLAG 24 | ||
258 | #define XFS_TRANS_CLEAR_AGI_BUCKET 25 | ||
259 | #define XFS_TRANS_QM_SBCHANGE 26 | ||
260 | /* | ||
261 | * Dummy entries since we use the transaction type to index into the | ||
262 | * trans_type[] in xlog_recover_print_trans_head() | ||
263 | */ | ||
264 | #define XFS_TRANS_DUMMY1 27 | ||
265 | #define XFS_TRANS_DUMMY2 28 | ||
266 | #define XFS_TRANS_QM_QUOTAOFF 29 | ||
267 | #define XFS_TRANS_QM_DQALLOC 30 | ||
268 | #define XFS_TRANS_QM_SETQLIM 31 | ||
269 | #define XFS_TRANS_QM_DQCLUSTER 32 | ||
270 | #define XFS_TRANS_QM_QINOCREATE 33 | ||
271 | #define XFS_TRANS_QM_QUOTAOFF_END 34 | ||
272 | #define XFS_TRANS_SB_UNIT 35 | ||
273 | #define XFS_TRANS_FSYNC_TS 36 | ||
274 | #define XFS_TRANS_GROWFSRT_ALLOC 37 | ||
275 | #define XFS_TRANS_GROWFSRT_ZERO 38 | ||
276 | #define XFS_TRANS_GROWFSRT_FREE 39 | ||
277 | #define XFS_TRANS_SWAPEXT 40 | ||
278 | #define XFS_TRANS_SB_COUNT 41 | ||
279 | #define XFS_TRANS_CHECKPOINT 42 | ||
280 | #define XFS_TRANS_ICREATE 43 | ||
281 | #define XFS_TRANS_TYPE_MAX 43 | ||
282 | /* new transaction types need to be reflected in xfs_logprint(8) */ | ||
283 | |||
284 | #define XFS_TRANS_TYPES \ | ||
285 | { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \ | ||
286 | { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \ | ||
287 | { XFS_TRANS_INACTIVE, "INACTIVE" }, \ | ||
288 | { XFS_TRANS_CREATE, "CREATE" }, \ | ||
289 | { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \ | ||
290 | { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \ | ||
291 | { XFS_TRANS_REMOVE, "REMOVE" }, \ | ||
292 | { XFS_TRANS_LINK, "LINK" }, \ | ||
293 | { XFS_TRANS_RENAME, "RENAME" }, \ | ||
294 | { XFS_TRANS_MKDIR, "MKDIR" }, \ | ||
295 | { XFS_TRANS_RMDIR, "RMDIR" }, \ | ||
296 | { XFS_TRANS_SYMLINK, "SYMLINK" }, \ | ||
297 | { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \ | ||
298 | { XFS_TRANS_GROWFS, "GROWFS" }, \ | ||
299 | { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \ | ||
300 | { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \ | ||
301 | { XFS_TRANS_WRITEID, "WRITEID" }, \ | ||
302 | { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \ | ||
303 | { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \ | ||
304 | { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \ | ||
305 | { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \ | ||
306 | { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \ | ||
307 | { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \ | ||
308 | { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \ | ||
309 | { XFS_TRANS_QM_SBCHANGE, "QM_SBCHANGE" }, \ | ||
310 | { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \ | ||
311 | { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \ | ||
312 | { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \ | ||
313 | { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \ | ||
314 | { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \ | ||
315 | { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \ | ||
316 | { XFS_TRANS_SB_UNIT, "SB_UNIT" }, \ | ||
317 | { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \ | ||
318 | { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \ | ||
319 | { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \ | ||
320 | { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \ | ||
321 | { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \ | ||
322 | { XFS_TRANS_SB_COUNT, "SB_COUNT" }, \ | ||
323 | { XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \ | ||
324 | { XFS_TRANS_DUMMY1, "DUMMY1" }, \ | ||
325 | { XFS_TRANS_DUMMY2, "DUMMY2" }, \ | ||
326 | { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" } | ||
327 | |||
328 | /* | ||
329 | * This structure is used to track log items associated with | ||
330 | * a transaction. It points to the log item and keeps some | ||
331 | * flags to track the state of the log item. It also tracks | ||
332 | * the amount of space needed to log the item it describes | ||
333 | * once we get to commit processing (see xfs_trans_commit()). | ||
334 | */ | ||
335 | struct xfs_log_item_desc { | ||
336 | struct xfs_log_item *lid_item; | ||
337 | struct list_head lid_trans; | ||
338 | unsigned char lid_flags; | ||
339 | }; | ||
340 | |||
341 | #define XFS_LID_DIRTY 0x1 | ||
342 | |||
343 | /* | ||
344 | * Values for t_flags. | ||
345 | */ | ||
346 | #define XFS_TRANS_DIRTY 0x01 /* something needs to be logged */ | ||
347 | #define XFS_TRANS_SB_DIRTY 0x02 /* superblock is modified */ | ||
348 | #define XFS_TRANS_PERM_LOG_RES 0x04 /* xact took a permanent log res */ | ||
349 | #define XFS_TRANS_SYNC 0x08 /* make commit synchronous */ | ||
350 | #define XFS_TRANS_DQ_DIRTY 0x10 /* at least one dquot in trx dirty */ | ||
351 | #define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */ | ||
352 | #define XFS_TRANS_FREEZE_PROT 0x40 /* Transaction has elevated writer | ||
353 | count in superblock */ | ||
354 | |||
355 | /* | ||
356 | * Values for call flags parameter. | ||
357 | */ | ||
358 | #define XFS_TRANS_RELEASE_LOG_RES 0x4 | ||
359 | #define XFS_TRANS_ABORT 0x8 | ||
360 | |||
361 | /* | ||
362 | * Field values for xfs_trans_mod_sb. | ||
363 | */ | ||
364 | #define XFS_TRANS_SB_ICOUNT 0x00000001 | ||
365 | #define XFS_TRANS_SB_IFREE 0x00000002 | ||
366 | #define XFS_TRANS_SB_FDBLOCKS 0x00000004 | ||
367 | #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008 | ||
368 | #define XFS_TRANS_SB_FREXTENTS 0x00000010 | ||
369 | #define XFS_TRANS_SB_RES_FREXTENTS 0x00000020 | ||
370 | #define XFS_TRANS_SB_DBLOCKS 0x00000040 | ||
371 | #define XFS_TRANS_SB_AGCOUNT 0x00000080 | ||
372 | #define XFS_TRANS_SB_IMAXPCT 0x00000100 | ||
373 | #define XFS_TRANS_SB_REXTSIZE 0x00000200 | ||
374 | #define XFS_TRANS_SB_RBMBLOCKS 0x00000400 | ||
375 | #define XFS_TRANS_SB_RBLOCKS 0x00000800 | ||
376 | #define XFS_TRANS_SB_REXTENTS 0x00001000 | ||
377 | #define XFS_TRANS_SB_REXTSLOG 0x00002000 | ||
378 | |||
379 | /* | ||
380 | * Here we centralize the specification of XFS meta-data buffer | ||
381 | * reference count values. This determine how hard the buffer | ||
382 | * cache tries to hold onto the buffer. | ||
383 | */ | ||
384 | #define XFS_AGF_REF 4 | ||
385 | #define XFS_AGI_REF 4 | ||
386 | #define XFS_AGFL_REF 3 | ||
387 | #define XFS_INO_BTREE_REF 3 | ||
388 | #define XFS_ALLOC_BTREE_REF 2 | ||
389 | #define XFS_BMAP_BTREE_REF 2 | ||
390 | #define XFS_DIR_BTREE_REF 2 | ||
391 | #define XFS_INO_REF 2 | ||
392 | #define XFS_ATTR_BTREE_REF 1 | ||
393 | #define XFS_DQUOT_REF 1 | ||
394 | |||
395 | /* | ||
190 | * Inode Log Item Format definitions. | 396 | * Inode Log Item Format definitions. |
191 | * | 397 | * |
192 | * This is the structure used to lay out an inode log item in the | 398 | * This is the structure used to lay out an inode log item in the |
diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 1d2a0613cf6a..9b70df3cdcd7 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c | |||
@@ -744,7 +744,7 @@ _xfs_trans_alloc( | |||
744 | atomic_inc(&mp->m_active_trans); | 744 | atomic_inc(&mp->m_active_trans); |
745 | 745 | ||
746 | tp = kmem_zone_zalloc(xfs_trans_zone, memflags); | 746 | tp = kmem_zone_zalloc(xfs_trans_zone, memflags); |
747 | tp->t_magic = XFS_TRANS_MAGIC; | 747 | tp->t_magic = XFS_TRANS_HEADER_MAGIC; |
748 | tp->t_type = type; | 748 | tp->t_type = type; |
749 | tp->t_mountp = mp; | 749 | tp->t_mountp = mp; |
750 | INIT_LIST_HEAD(&tp->t_items); | 750 | INIT_LIST_HEAD(&tp->t_items); |
@@ -789,7 +789,7 @@ xfs_trans_dup( | |||
789 | /* | 789 | /* |
790 | * Initialize the new transaction structure. | 790 | * Initialize the new transaction structure. |
791 | */ | 791 | */ |
792 | ntp->t_magic = XFS_TRANS_MAGIC; | 792 | ntp->t_magic = XFS_TRANS_HEADER_MAGIC; |
793 | ntp->t_type = tp->t_type; | 793 | ntp->t_type = tp->t_type; |
794 | ntp->t_mountp = tp->t_mountp; | 794 | ntp->t_mountp = tp->t_mountp; |
795 | INIT_LIST_HEAD(&ntp->t_items); | 795 | INIT_LIST_HEAD(&ntp->t_items); |
diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 2b4946393e30..ffaa5842ab1f 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h | |||
@@ -21,195 +21,6 @@ | |||
21 | struct xfs_log_item; | 21 | struct xfs_log_item; |
22 | 22 | ||
23 | /* | 23 | /* |
24 | * This is the structure written in the log at the head of | ||
25 | * every transaction. It identifies the type and id of the | ||
26 | * transaction, and contains the number of items logged by | ||
27 | * the transaction so we know how many to expect during recovery. | ||
28 | * | ||
29 | * Do not change the below structure without redoing the code in | ||
30 | * xlog_recover_add_to_trans() and xlog_recover_add_to_cont_trans(). | ||
31 | */ | ||
32 | typedef struct xfs_trans_header { | ||
33 | uint th_magic; /* magic number */ | ||
34 | uint th_type; /* transaction type */ | ||
35 | __int32_t th_tid; /* transaction id (unused) */ | ||
36 | uint th_num_items; /* num items logged by trans */ | ||
37 | } xfs_trans_header_t; | ||
38 | |||
39 | #define XFS_TRANS_HEADER_MAGIC 0x5452414e /* TRAN */ | ||
40 | |||
41 | /* | ||
42 | * Log item types. | ||
43 | */ | ||
44 | #define XFS_LI_EFI 0x1236 | ||
45 | #define XFS_LI_EFD 0x1237 | ||
46 | #define XFS_LI_IUNLINK 0x1238 | ||
47 | #define XFS_LI_INODE 0x123b /* aligned ino chunks, var-size ibufs */ | ||
48 | #define XFS_LI_BUF 0x123c /* v2 bufs, variable sized inode bufs */ | ||
49 | #define XFS_LI_DQUOT 0x123d | ||
50 | #define XFS_LI_QUOTAOFF 0x123e | ||
51 | #define XFS_LI_ICREATE 0x123f | ||
52 | |||
53 | #define XFS_LI_TYPE_DESC \ | ||
54 | { XFS_LI_EFI, "XFS_LI_EFI" }, \ | ||
55 | { XFS_LI_EFD, "XFS_LI_EFD" }, \ | ||
56 | { XFS_LI_IUNLINK, "XFS_LI_IUNLINK" }, \ | ||
57 | { XFS_LI_INODE, "XFS_LI_INODE" }, \ | ||
58 | { XFS_LI_BUF, "XFS_LI_BUF" }, \ | ||
59 | { XFS_LI_DQUOT, "XFS_LI_DQUOT" }, \ | ||
60 | { XFS_LI_QUOTAOFF, "XFS_LI_QUOTAOFF" } | ||
61 | |||
62 | /* | ||
63 | * Transaction types. Used to distinguish types of buffers. | ||
64 | */ | ||
65 | #define XFS_TRANS_SETATTR_NOT_SIZE 1 | ||
66 | #define XFS_TRANS_SETATTR_SIZE 2 | ||
67 | #define XFS_TRANS_INACTIVE 3 | ||
68 | #define XFS_TRANS_CREATE 4 | ||
69 | #define XFS_TRANS_CREATE_TRUNC 5 | ||
70 | #define XFS_TRANS_TRUNCATE_FILE 6 | ||
71 | #define XFS_TRANS_REMOVE 7 | ||
72 | #define XFS_TRANS_LINK 8 | ||
73 | #define XFS_TRANS_RENAME 9 | ||
74 | #define XFS_TRANS_MKDIR 10 | ||
75 | #define XFS_TRANS_RMDIR 11 | ||
76 | #define XFS_TRANS_SYMLINK 12 | ||
77 | #define XFS_TRANS_SET_DMATTRS 13 | ||
78 | #define XFS_TRANS_GROWFS 14 | ||
79 | #define XFS_TRANS_STRAT_WRITE 15 | ||
80 | #define XFS_TRANS_DIOSTRAT 16 | ||
81 | /* 17 was XFS_TRANS_WRITE_SYNC */ | ||
82 | #define XFS_TRANS_WRITEID 18 | ||
83 | #define XFS_TRANS_ADDAFORK 19 | ||
84 | #define XFS_TRANS_ATTRINVAL 20 | ||
85 | #define XFS_TRANS_ATRUNCATE 21 | ||
86 | #define XFS_TRANS_ATTR_SET 22 | ||
87 | #define XFS_TRANS_ATTR_RM 23 | ||
88 | #define XFS_TRANS_ATTR_FLAG 24 | ||
89 | #define XFS_TRANS_CLEAR_AGI_BUCKET 25 | ||
90 | #define XFS_TRANS_QM_SBCHANGE 26 | ||
91 | /* | ||
92 | * Dummy entries since we use the transaction type to index into the | ||
93 | * trans_type[] in xlog_recover_print_trans_head() | ||
94 | */ | ||
95 | #define XFS_TRANS_DUMMY1 27 | ||
96 | #define XFS_TRANS_DUMMY2 28 | ||
97 | #define XFS_TRANS_QM_QUOTAOFF 29 | ||
98 | #define XFS_TRANS_QM_DQALLOC 30 | ||
99 | #define XFS_TRANS_QM_SETQLIM 31 | ||
100 | #define XFS_TRANS_QM_DQCLUSTER 32 | ||
101 | #define XFS_TRANS_QM_QINOCREATE 33 | ||
102 | #define XFS_TRANS_QM_QUOTAOFF_END 34 | ||
103 | #define XFS_TRANS_SB_UNIT 35 | ||
104 | #define XFS_TRANS_FSYNC_TS 36 | ||
105 | #define XFS_TRANS_GROWFSRT_ALLOC 37 | ||
106 | #define XFS_TRANS_GROWFSRT_ZERO 38 | ||
107 | #define XFS_TRANS_GROWFSRT_FREE 39 | ||
108 | #define XFS_TRANS_SWAPEXT 40 | ||
109 | #define XFS_TRANS_SB_COUNT 41 | ||
110 | #define XFS_TRANS_CHECKPOINT 42 | ||
111 | #define XFS_TRANS_ICREATE 43 | ||
112 | #define XFS_TRANS_TYPE_MAX 43 | ||
113 | /* new transaction types need to be reflected in xfs_logprint(8) */ | ||
114 | |||
115 | #define XFS_TRANS_TYPES \ | ||
116 | { XFS_TRANS_SETATTR_NOT_SIZE, "SETATTR_NOT_SIZE" }, \ | ||
117 | { XFS_TRANS_SETATTR_SIZE, "SETATTR_SIZE" }, \ | ||
118 | { XFS_TRANS_INACTIVE, "INACTIVE" }, \ | ||
119 | { XFS_TRANS_CREATE, "CREATE" }, \ | ||
120 | { XFS_TRANS_CREATE_TRUNC, "CREATE_TRUNC" }, \ | ||
121 | { XFS_TRANS_TRUNCATE_FILE, "TRUNCATE_FILE" }, \ | ||
122 | { XFS_TRANS_REMOVE, "REMOVE" }, \ | ||
123 | { XFS_TRANS_LINK, "LINK" }, \ | ||
124 | { XFS_TRANS_RENAME, "RENAME" }, \ | ||
125 | { XFS_TRANS_MKDIR, "MKDIR" }, \ | ||
126 | { XFS_TRANS_RMDIR, "RMDIR" }, \ | ||
127 | { XFS_TRANS_SYMLINK, "SYMLINK" }, \ | ||
128 | { XFS_TRANS_SET_DMATTRS, "SET_DMATTRS" }, \ | ||
129 | { XFS_TRANS_GROWFS, "GROWFS" }, \ | ||
130 | { XFS_TRANS_STRAT_WRITE, "STRAT_WRITE" }, \ | ||
131 | { XFS_TRANS_DIOSTRAT, "DIOSTRAT" }, \ | ||
132 | { XFS_TRANS_WRITEID, "WRITEID" }, \ | ||
133 | { XFS_TRANS_ADDAFORK, "ADDAFORK" }, \ | ||
134 | { XFS_TRANS_ATTRINVAL, "ATTRINVAL" }, \ | ||
135 | { XFS_TRANS_ATRUNCATE, "ATRUNCATE" }, \ | ||
136 | { XFS_TRANS_ATTR_SET, "ATTR_SET" }, \ | ||
137 | { XFS_TRANS_ATTR_RM, "ATTR_RM" }, \ | ||
138 | { XFS_TRANS_ATTR_FLAG, "ATTR_FLAG" }, \ | ||
139 | { XFS_TRANS_CLEAR_AGI_BUCKET, "CLEAR_AGI_BUCKET" }, \ | ||
140 | { XFS_TRANS_QM_SBCHANGE, "QM_SBCHANGE" }, \ | ||
141 | { XFS_TRANS_QM_QUOTAOFF, "QM_QUOTAOFF" }, \ | ||
142 | { XFS_TRANS_QM_DQALLOC, "QM_DQALLOC" }, \ | ||
143 | { XFS_TRANS_QM_SETQLIM, "QM_SETQLIM" }, \ | ||
144 | { XFS_TRANS_QM_DQCLUSTER, "QM_DQCLUSTER" }, \ | ||
145 | { XFS_TRANS_QM_QINOCREATE, "QM_QINOCREATE" }, \ | ||
146 | { XFS_TRANS_QM_QUOTAOFF_END, "QM_QOFF_END" }, \ | ||
147 | { XFS_TRANS_SB_UNIT, "SB_UNIT" }, \ | ||
148 | { XFS_TRANS_FSYNC_TS, "FSYNC_TS" }, \ | ||
149 | { XFS_TRANS_GROWFSRT_ALLOC, "GROWFSRT_ALLOC" }, \ | ||
150 | { XFS_TRANS_GROWFSRT_ZERO, "GROWFSRT_ZERO" }, \ | ||
151 | { XFS_TRANS_GROWFSRT_FREE, "GROWFSRT_FREE" }, \ | ||
152 | { XFS_TRANS_SWAPEXT, "SWAPEXT" }, \ | ||
153 | { XFS_TRANS_SB_COUNT, "SB_COUNT" }, \ | ||
154 | { XFS_TRANS_CHECKPOINT, "CHECKPOINT" }, \ | ||
155 | { XFS_TRANS_DUMMY1, "DUMMY1" }, \ | ||
156 | { XFS_TRANS_DUMMY2, "DUMMY2" }, \ | ||
157 | { XLOG_UNMOUNT_REC_TYPE, "UNMOUNT" } | ||
158 | |||
159 | /* | ||
160 | * This structure is used to track log items associated with | ||
161 | * a transaction. It points to the log item and keeps some | ||
162 | * flags to track the state of the log item. It also tracks | ||
163 | * the amount of space needed to log the item it describes | ||
164 | * once we get to commit processing (see xfs_trans_commit()). | ||
165 | */ | ||
166 | struct xfs_log_item_desc { | ||
167 | struct xfs_log_item *lid_item; | ||
168 | struct list_head lid_trans; | ||
169 | unsigned char lid_flags; | ||
170 | }; | ||
171 | |||
172 | #define XFS_LID_DIRTY 0x1 | ||
173 | |||
174 | #define XFS_TRANS_MAGIC 0x5452414E /* 'TRAN' */ | ||
175 | /* | ||
176 | * Values for t_flags. | ||
177 | */ | ||
178 | #define XFS_TRANS_DIRTY 0x01 /* something needs to be logged */ | ||
179 | #define XFS_TRANS_SB_DIRTY 0x02 /* superblock is modified */ | ||
180 | #define XFS_TRANS_PERM_LOG_RES 0x04 /* xact took a permanent log res */ | ||
181 | #define XFS_TRANS_SYNC 0x08 /* make commit synchronous */ | ||
182 | #define XFS_TRANS_DQ_DIRTY 0x10 /* at least one dquot in trx dirty */ | ||
183 | #define XFS_TRANS_RESERVE 0x20 /* OK to use reserved data blocks */ | ||
184 | #define XFS_TRANS_FREEZE_PROT 0x40 /* Transaction has elevated writer | ||
185 | count in superblock */ | ||
186 | |||
187 | /* | ||
188 | * Values for call flags parameter. | ||
189 | */ | ||
190 | #define XFS_TRANS_RELEASE_LOG_RES 0x4 | ||
191 | #define XFS_TRANS_ABORT 0x8 | ||
192 | |||
193 | /* | ||
194 | * Field values for xfs_trans_mod_sb. | ||
195 | */ | ||
196 | #define XFS_TRANS_SB_ICOUNT 0x00000001 | ||
197 | #define XFS_TRANS_SB_IFREE 0x00000002 | ||
198 | #define XFS_TRANS_SB_FDBLOCKS 0x00000004 | ||
199 | #define XFS_TRANS_SB_RES_FDBLOCKS 0x00000008 | ||
200 | #define XFS_TRANS_SB_FREXTENTS 0x00000010 | ||
201 | #define XFS_TRANS_SB_RES_FREXTENTS 0x00000020 | ||
202 | #define XFS_TRANS_SB_DBLOCKS 0x00000040 | ||
203 | #define XFS_TRANS_SB_AGCOUNT 0x00000080 | ||
204 | #define XFS_TRANS_SB_IMAXPCT 0x00000100 | ||
205 | #define XFS_TRANS_SB_REXTSIZE 0x00000200 | ||
206 | #define XFS_TRANS_SB_RBMBLOCKS 0x00000400 | ||
207 | #define XFS_TRANS_SB_RBLOCKS 0x00000800 | ||
208 | #define XFS_TRANS_SB_REXTENTS 0x00001000 | ||
209 | #define XFS_TRANS_SB_REXTSLOG 0x00002000 | ||
210 | |||
211 | |||
212 | /* | ||
213 | * Per-extent log reservation for the allocation btree changes | 24 | * Per-extent log reservation for the allocation btree changes |
214 | * involved in freeing or allocating an extent. | 25 | * involved in freeing or allocating an extent. |
215 | * 2 trees * (2 blocks/level * max depth - 1) | 26 | * 2 trees * (2 blocks/level * max depth - 1) |
@@ -282,22 +93,6 @@ struct xfs_log_item_desc { | |||
282 | #define XFS_ATTRSET_LOG_COUNT 3 | 93 | #define XFS_ATTRSET_LOG_COUNT 3 |
283 | #define XFS_ATTRRM_LOG_COUNT 3 | 94 | #define XFS_ATTRRM_LOG_COUNT 3 |
284 | 95 | ||
285 | /* | ||
286 | * Here we centralize the specification of XFS meta-data buffer | ||
287 | * reference count values. This determine how hard the buffer | ||
288 | * cache tries to hold onto the buffer. | ||
289 | */ | ||
290 | #define XFS_AGF_REF 4 | ||
291 | #define XFS_AGI_REF 4 | ||
292 | #define XFS_AGFL_REF 3 | ||
293 | #define XFS_INO_BTREE_REF 3 | ||
294 | #define XFS_ALLOC_BTREE_REF 2 | ||
295 | #define XFS_BMAP_BTREE_REF 2 | ||
296 | #define XFS_DIR_BTREE_REF 2 | ||
297 | #define XFS_INO_REF 2 | ||
298 | #define XFS_ATTR_BTREE_REF 1 | ||
299 | #define XFS_DQUOT_REF 1 | ||
300 | |||
301 | #ifdef __KERNEL__ | 96 | #ifdef __KERNEL__ |
302 | 97 | ||
303 | struct xfs_buf; | 98 | struct xfs_buf; |