Commit a31437b8 authored by Lukas Czerner's avatar Lukas Czerner Committed by Theodore Ts'o

ext4: use sb_issue_zeroout in setup_new_group_blocks

Use sb_issue_zeroout to zero out inode table and descriptor table
blocks instead of old approach which involves journaling.
Signed-off-by: default avatarLukas Czerner <lczerner@redhat.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent 857ac889
...@@ -226,23 +226,13 @@ static int setup_new_group_blocks(struct super_block *sb, ...@@ -226,23 +226,13 @@ static int setup_new_group_blocks(struct super_block *sb,
} }
/* Zero out all of the reserved backup group descriptor table blocks */ /* Zero out all of the reserved backup group descriptor table blocks */
for (i = 0, bit = gdblocks + 1, block = start + bit; ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
i < reserved_gdb; i++, block++, bit++) { block, sbi->s_itb_per_group);
struct buffer_head *gdb; err = sb_issue_zeroout(sb, gdblocks + start + 1, reserved_gdb,
GFP_NOFS, BLKDEV_IFL_WAIT);
ext4_debug("clear reserved block %#04llx (+%d)\n", block, bit); if (err)
goto exit_bh;
if ((err = extend_or_restart_transaction(handle, 1, bh)))
goto exit_bh;
if (IS_ERR(gdb = bclean(handle, sb, block))) {
err = PTR_ERR(gdb);
goto exit_bh;
}
ext4_handle_dirty_metadata(handle, NULL, gdb);
ext4_set_bit(bit, bh->b_data);
brelse(gdb);
}
ext4_debug("mark block bitmap %#04llx (+%llu)\n", input->block_bitmap, ext4_debug("mark block bitmap %#04llx (+%llu)\n", input->block_bitmap,
input->block_bitmap - start); input->block_bitmap - start);
ext4_set_bit(input->block_bitmap - start, bh->b_data); ext4_set_bit(input->block_bitmap - start, bh->b_data);
...@@ -251,23 +241,13 @@ static int setup_new_group_blocks(struct super_block *sb, ...@@ -251,23 +241,13 @@ static int setup_new_group_blocks(struct super_block *sb,
ext4_set_bit(input->inode_bitmap - start, bh->b_data); ext4_set_bit(input->inode_bitmap - start, bh->b_data);
/* Zero out all of the inode table blocks */ /* Zero out all of the inode table blocks */
for (i = 0, block = input->inode_table, bit = block - start; block = input->inode_table;
i < sbi->s_itb_per_group; i++, bit++, block++) { ext4_debug("clear inode table blocks %#04llx -> %#04llx\n",
struct buffer_head *it; block, sbi->s_itb_per_group);
err = sb_issue_zeroout(sb, block, sbi->s_itb_per_group,
ext4_debug("clear inode block %#04llx (+%d)\n", block, bit); GFP_NOFS, BLKDEV_IFL_WAIT);
if (err)
if ((err = extend_or_restart_transaction(handle, 1, bh))) goto exit_bh;
goto exit_bh;
if (IS_ERR(it = bclean(handle, sb, block))) {
err = PTR_ERR(it);
goto exit_bh;
}
ext4_handle_dirty_metadata(handle, NULL, it);
brelse(it);
ext4_set_bit(bit, bh->b_data);
}
if ((err = extend_or_restart_transaction(handle, 2, bh))) if ((err = extend_or_restart_transaction(handle, 2, bh)))
goto exit_bh; goto exit_bh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment