1 ext4: remove block bitmap initialization in ext4_new_inode()
3 We are initializing the block bitmap in ext4_new_inode(), and as far
4 as I can tell, there's no reason to do it. So remove it to simplify
7 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
9 fs/ext4/ialloc.c | 37 -------------------------------------
10 1 files changed, 0 insertions(+), 37 deletions(-)
12 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
13 index 2fd3b0e..6e88327 100644
14 --- a/fs/ext4/ialloc.c
15 +++ b/fs/ext4/ialloc.c
16 @@ -815,7 +815,6 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode,
22 ext4_group_t flex_group;
24 @@ -936,42 +935,6 @@ repeat_in_this_group:
28 - /* We may have to initialize the block bitmap if it isn't already */
29 - if (EXT4_HAS_RO_COMPAT_FEATURE(sb, EXT4_FEATURE_RO_COMPAT_GDT_CSUM) &&
30 - gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
31 - struct buffer_head *block_bitmap_bh;
33 - block_bitmap_bh = ext4_read_block_bitmap(sb, group);
34 - BUFFER_TRACE(block_bitmap_bh, "get block bitmap access");
35 - err = ext4_journal_get_write_access(handle, block_bitmap_bh);
37 - brelse(block_bitmap_bh);
42 - ext4_lock_group(sb, group);
43 - /* recheck and clear flag under lock if we still need to */
44 - if (gdp->bg_flags & cpu_to_le16(EXT4_BG_BLOCK_UNINIT)) {
45 - free = ext4_free_blocks_after_init(sb, group, gdp);
46 - gdp->bg_flags &= cpu_to_le16(~EXT4_BG_BLOCK_UNINIT);
47 - ext4_free_blks_set(sb, gdp, free);
48 - gdp->bg_checksum = ext4_group_desc_csum(sbi, group,
51 - ext4_unlock_group(sb, group);
53 - /* Don't need to dirty bitmap block if we didn't change it */
55 - BUFFER_TRACE(block_bitmap_bh, "dirty block bitmap");
56 - err = ext4_handle_dirty_metadata(handle,
57 - NULL, block_bitmap_bh);
60 - brelse(block_bitmap_bh);
64 BUFFER_TRACE(group_desc_bh, "call ext4_handle_dirty_metadata");
65 err = ext4_handle_dirty_metadata(handle, NULL, group_desc_bh);