Skip to content

Commit

Permalink
ext4: scope ret locally in ext4_try_to_trim_range()
Browse files Browse the repository at this point in the history
As commit 6920b39 ("ext4: add new helper interface
ext4_try_to_trim_range()") moves some code into the separate function
ext4_try_to_trim_range(), the use of the variable ret within that
function is more limited and can be adjusted as well.

Scope the use of the variable ret locally and drop dead assignments.

No functional change.

Signed-off-by: Lukas Bulwahn <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
  • Loading branch information
bulwahn authored and tytso committed Nov 4, 2021
1 parent 3bbef91 commit afcc4e3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6299,7 +6299,6 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
{
ext4_grpblk_t next, count, free_count;
void *bitmap;
int ret = 0;

bitmap = e4b->bd_bitmap;
start = (e4b->bd_info->bb_first_free > start) ?
Expand All @@ -6314,10 +6313,10 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
next = mb_find_next_bit(bitmap, max + 1, start);

if ((next - start) >= minblocks) {
ret = ext4_trim_extent(sb, start, next - start, e4b);
int ret = ext4_trim_extent(sb, start, next - start, e4b);

if (ret && ret != -EOPNOTSUPP)
break;
ret = 0;
count += next - start;
}
free_count += next - start;
Expand Down

0 comments on commit afcc4e3

Please sign in to comment.