提交 afcc4e32 编写于 作者: L Lukas Bulwahn 提交者: Theodore Ts'o

ext4: scope ret locally in ext4_try_to_trim_range()

As commit 6920b391 ("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: NLukas Bulwahn <lukas.bulwahn@gmail.com>
Link: https://lore.kernel.org/r/20210820120853.23134-1-lukas.bulwahn@gmail.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
上级 3bbef91b
...@@ -6299,7 +6299,6 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group)) ...@@ -6299,7 +6299,6 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
{ {
ext4_grpblk_t next, count, free_count; ext4_grpblk_t next, count, free_count;
void *bitmap; void *bitmap;
int ret = 0;
bitmap = e4b->bd_bitmap; bitmap = e4b->bd_bitmap;
start = (e4b->bd_info->bb_first_free > start) ? start = (e4b->bd_info->bb_first_free > start) ?
...@@ -6314,10 +6313,10 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group)) ...@@ -6314,10 +6313,10 @@ __releases(ext4_group_lock_ptr(sb, e4b->bd_group))
next = mb_find_next_bit(bitmap, max + 1, start); next = mb_find_next_bit(bitmap, max + 1, start);
if ((next - start) >= minblocks) { 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) if (ret && ret != -EOPNOTSUPP)
break; break;
ret = 0;
count += next - start; count += next - start;
} }
free_count += next - start; free_count += next - start;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册