diff options
Diffstat (limited to 'fs/ext4/ext4_jbd2.h')
-rw-r--r-- | fs/ext4/ext4_jbd2.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h index f440e8f1841f..56d258c18303 100644 --- a/fs/ext4/ext4_jbd2.h +++ b/fs/ext4/ext4_jbd2.h | |||
@@ -87,14 +87,20 @@ | |||
87 | #ifdef CONFIG_QUOTA | 87 | #ifdef CONFIG_QUOTA |
88 | /* Amount of blocks needed for quota update - we know that the structure was | 88 | /* Amount of blocks needed for quota update - we know that the structure was |
89 | * allocated so we need to update only data block */ | 89 | * allocated so we need to update only data block */ |
90 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) (test_opt(sb, QUOTA) ? 1 : 0) | 90 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) ((test_opt(sb, QUOTA) ||\ |
91 | EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) ?\ | ||
92 | 1 : 0) | ||
91 | /* Amount of blocks needed for quota insert/delete - we do some block writes | 93 | /* Amount of blocks needed for quota insert/delete - we do some block writes |
92 | * but inode, sb and group updates are done only once */ | 94 | * but inode, sb and group updates are done only once */ |
93 | #define EXT4_QUOTA_INIT_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_INIT_ALLOC*\ | 95 | #define EXT4_QUOTA_INIT_BLOCKS(sb) ((test_opt(sb, QUOTA) ||\ |
94 | (EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)+3+DQUOT_INIT_REWRITE) : 0) | 96 | EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) ?\ |
95 | 97 | (DQUOT_INIT_ALLOC*(EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)\ | |
96 | #define EXT4_QUOTA_DEL_BLOCKS(sb) (test_opt(sb, QUOTA) ? (DQUOT_DEL_ALLOC*\ | 98 | +3+DQUOT_INIT_REWRITE) : 0) |
97 | (EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)+3+DQUOT_DEL_REWRITE) : 0) | 99 | |
100 | #define EXT4_QUOTA_DEL_BLOCKS(sb) ((test_opt(sb, QUOTA) ||\ | ||
101 | EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_QUOTA)) ?\ | ||
102 | (DQUOT_DEL_ALLOC*(EXT4_SINGLEDATA_TRANS_BLOCKS(sb)-3)\ | ||
103 | +3+DQUOT_DEL_REWRITE) : 0) | ||
98 | #else | 104 | #else |
99 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) 0 | 105 | #define EXT4_QUOTA_TRANS_BLOCKS(sb) 0 |
100 | #define EXT4_QUOTA_INIT_BLOCKS(sb) 0 | 106 | #define EXT4_QUOTA_INIT_BLOCKS(sb) 0 |
@@ -213,8 +219,7 @@ int __ext4_handle_dirty_metadata(const char *where, unsigned int line, | |||
213 | struct buffer_head *bh); | 219 | struct buffer_head *bh); |
214 | 220 | ||
215 | int __ext4_handle_dirty_super(const char *where, unsigned int line, | 221 | int __ext4_handle_dirty_super(const char *where, unsigned int line, |
216 | handle_t *handle, struct super_block *sb, | 222 | handle_t *handle, struct super_block *sb); |
217 | int now); | ||
218 | 223 | ||
219 | #define ext4_journal_get_write_access(handle, bh) \ | 224 | #define ext4_journal_get_write_access(handle, bh) \ |
220 | __ext4_journal_get_write_access(__func__, __LINE__, (handle), (bh)) | 225 | __ext4_journal_get_write_access(__func__, __LINE__, (handle), (bh)) |
@@ -226,10 +231,8 @@ int __ext4_handle_dirty_super(const char *where, unsigned int line, | |||
226 | #define ext4_handle_dirty_metadata(handle, inode, bh) \ | 231 | #define ext4_handle_dirty_metadata(handle, inode, bh) \ |
227 | __ext4_handle_dirty_metadata(__func__, __LINE__, (handle), (inode), \ | 232 | __ext4_handle_dirty_metadata(__func__, __LINE__, (handle), (inode), \ |
228 | (bh)) | 233 | (bh)) |
229 | #define ext4_handle_dirty_super_now(handle, sb) \ | ||
230 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb), 1) | ||
231 | #define ext4_handle_dirty_super(handle, sb) \ | 234 | #define ext4_handle_dirty_super(handle, sb) \ |
232 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb), 0) | 235 | __ext4_handle_dirty_super(__func__, __LINE__, (handle), (sb)) |
233 | 236 | ||
234 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); | 237 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks); |
235 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle); | 238 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle); |