aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/ext4.h
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2009-01-05 21:49:55 -0500
committerTheodore Ts'o <tytso@mit.edu>2009-01-05 21:49:55 -0500
commit2ccb5fb9f113dae969d1ae9b6c10e80fa34f8cd3 (patch)
treed9dc5bca94748d4173a7783e963d20b5a75f8db8 /fs/ext4/ext4.h
parent393418676a7602e1d7d3f6e560159c65c8cbd50e (diff)
ext4: Use new buffer_head flag to check uninit group bitmaps initialization
For uninit block group, the on-disk bitmap is not initialized. That implies we cannot depend on the uptodate flag on the bitmap buffer_head to find bitmap validity. Use a new buffer_head flag which would be set after we properly initialize the bitmap. This also prevents (re-)initializing the uninit group bitmap every time we call ext4_read_block_bitmap(). Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Cc: stable@kernel.org
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r--fs/ext4/ext4.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index ec862f4ca89f..695b45cc34e7 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -19,6 +19,7 @@
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/blkdev.h> 20#include <linux/blkdev.h>
21#include <linux/magic.h> 21#include <linux/magic.h>
22#include <linux/jbd2.h>
22#include "ext4_i.h" 23#include "ext4_i.h"
23 24
24/* 25/*
@@ -1352,6 +1353,23 @@ extern int ext4_get_blocks_wrap(handle_t *handle, struct inode *inode,
1352extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, 1353extern int ext4_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
1353 __u64 start, __u64 len); 1354 __u64 start, __u64 len);
1354 1355
1356/*
1357 * Add new method to test wether block and inode bitmaps are properly
1358 * initialized. With uninit_bg reading the block from disk is not enough
1359 * to mark the bitmap uptodate. We need to also zero-out the bitmap
1360 */
1361#define BH_BITMAP_UPTODATE BH_JBDPrivateStart
1362
1363static inline int bitmap_uptodate(struct buffer_head *bh)
1364{
1365 return (buffer_uptodate(bh) &&
1366 test_bit(BH_BITMAP_UPTODATE, &(bh)->b_state));
1367}
1368static inline void set_bitmap_uptodate(struct buffer_head *bh)
1369{
1370 set_bit(BH_BITMAP_UPTODATE, &(bh)->b_state);
1371}
1372
1355#endif /* __KERNEL__ */ 1373#endif /* __KERNEL__ */
1356 1374
1357#endif /* _EXT4_H */ 1375#endif /* _EXT4_H */