Commit ac3820f8 authored by Chengguang Xu's avatar Chengguang Xu Committed by Jan Kara

ext2: skip unnecessary operations in ext2_try_to_allocate()

Move 'repeat' tag to proper place so that we can
skip unnecessary operations in ext2_try_to_allocate().

Link: https://lore.kernel.org/r/20191104114036.9893-3-cgxu519@mykernel.netSigned-off-by: default avatarChengguang Xu <cgxu519@mykernel.net>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent cf4eb321
...@@ -684,7 +684,6 @@ ext2_try_to_allocate(struct super_block *sb, int group, ...@@ -684,7 +684,6 @@ ext2_try_to_allocate(struct super_block *sb, int group,
} }
BUG_ON(start > EXT2_BLOCKS_PER_GROUP(sb)); BUG_ON(start > EXT2_BLOCKS_PER_GROUP(sb));
repeat:
if (grp_goal < 0) { if (grp_goal < 0) {
grp_goal = find_next_usable_block(start, bitmap_bh, end); grp_goal = find_next_usable_block(start, bitmap_bh, end);
if (grp_goal < 0) if (grp_goal < 0)
...@@ -701,6 +700,7 @@ ext2_try_to_allocate(struct super_block *sb, int group, ...@@ -701,6 +700,7 @@ ext2_try_to_allocate(struct super_block *sb, int group,
} }
start = grp_goal; start = grp_goal;
repeat:
if (ext2_set_bit_atomic(sb_bgl_lock(EXT2_SB(sb), group), grp_goal, if (ext2_set_bit_atomic(sb_bgl_lock(EXT2_SB(sb), group), grp_goal,
bitmap_bh->b_data)) { bitmap_bh->b_data)) {
/* /*
......
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