diff options
Diffstat (limited to 'include/linux/ext4_jbd2.h')
-rw-r--r-- | include/linux/ext4_jbd2.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/ext4_jbd2.h b/include/linux/ext4_jbd2.h index 99d37557cbb4..aa273f024ad0 100644 --- a/include/linux/ext4_jbd2.h +++ b/include/linux/ext4_jbd2.h | |||
@@ -26,9 +26,14 @@ | |||
26 | * | 26 | * |
27 | * We may have to touch one inode, one bitmap buffer, up to three | 27 | * We may have to touch one inode, one bitmap buffer, up to three |
28 | * indirection blocks, the group and superblock summaries, and the data | 28 | * indirection blocks, the group and superblock summaries, and the data |
29 | * block to complete the transaction. */ | 29 | * block to complete the transaction. |
30 | * | ||
31 | * For extents-enabled fs we may have to allocate and modify upto | ||
32 | * 5 levels of tree + root which is stored in inode. */ | ||
30 | 33 | ||
31 | #define EXT4_SINGLEDATA_TRANS_BLOCKS 8U | 34 | #define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) \ |
35 | (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_EXTENTS) \ | ||
36 | || test_opt(sb, EXTENTS) ? 27U : 8U) | ||
32 | 37 | ||
33 | /* Extended attribute operations touch at most two data buffers, | 38 | /* Extended attribute operations touch at most two data buffers, |
34 | * two bitmap buffers, and two group summaries, in addition to the inode | 39 | * two bitmap buffers, and two group summaries, in addition to the inode |
@@ -42,7 +47,7 @@ | |||
42 | * superblock only gets updated once, of course, so don't bother | 47 | * superblock only gets updated once, of course, so don't bother |
43 | * counting that again for the quota updates. */ | 48 | * counting that again for the quota updates. */ |
44 | 49 | ||
45 | #define EXT4_DATA_TRANS_BLOCKS(sb) (EXT4_SINGLEDATA_TRANS_BLOCKS + \ | 50 | #define EXT4_DATA_TRANS_BLOCKS(sb) (EXT4_SINGLEDATA_TRANS_BLOCKS(sb) + \ |
46 | EXT4_XATTR_TRANS_BLOCKS - 2 + \ | 51 | EXT4_XATTR_TRANS_BLOCKS - 2 + \ |
47 | 2*EXT4_QUOTA_TRANS_BLOCKS(sb)) | 52 | 2*EXT4_QUOTA_TRANS_BLOCKS(sb)) |
48 | 53 | ||
@@ -78,9 +83,9 @@ | |||
78 | /* Amount of blocks needed for quota insert/delete - we do some block writes | 83 | /* Amount of blocks needed for quota insert/delete - we do some block writes |
79 | * but inode, sb and group updates are done only once */ | 84 | * but inode, sb and group updates are done only once */ |
80 | #define EXT4_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\ | 85 | #define EXT4_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\ |
81 | (EXT4_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_INIT_REWRITE) : 0) | 86 | (EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)+3+DQUOT_INIT_REWRITE) : 0) |
82 | #define EXT4_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_DEL_ALLOC*\ | 87 | #define EXT4_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_DEL_ALLOC*\ |
83 | (EXT4_SINGLEDATA_TRANS_BLOCKS-3)+3+DQUOT_DEL_REWRITE) : 0) | 88 | (EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)+3+DQUOT_DEL_REWRITE) : 0) |
84 | #else | 89 | #else |
85 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) 0 | 90 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) 0 |
86 | #define EXT4_QUOTA_INIT_BLOCKS(sb) 0 | 91 | #define EXT4_QUOTA_INIT_BLOCKS(sb) 0 |