summaryrefslogtreecommitdiff
path: root/fs/ext4
diff options
context:
space:
mode:
authorLukas Bulwahn <lukas.bulwahn@gmail.com>2021-08-20 15:08:53 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-10 22:46:36 +0300
commit2d874151584d4728a34072549c405ce0fa23992b (patch)
tree4a503b0ead3c34bf264fdffd76f411efe28163b2 /fs/ext4
parentc71cb46affe915b48faff0e604a9cd34df0bbf76 (diff)
downloadlinux-2d874151584d4728a34072549c405ce0fa23992b.tar.xz
ext4: scope ret locally in ext4_try_to_trim_range()
[ Upstream commit afcc4e32f606dbfb47aa7309172c89174b86e74c ] As commit 6920b3913235 ("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 <lukas.bulwahn@gmail.com> Link: https://lore.kernel.org/r/20210820120853.23134-1-lukas.bulwahn@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Stable-dep-of: 45e4ab320c9b ("ext4: move setting of trimmed bit into ext4_try_to_trim_range()") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/mballoc.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 5a7fe5aa0fc3..e1b487acb843 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -5200,7 +5200,6 @@ static int ext4_try_to_trim_range(struct super_block *sb,
{
ext4_grpblk_t next, count, free_count;
void *bitmap;
- int ret = 0;
bitmap = e4b->bd_bitmap;
start = (e4b->bd_info->bb_first_free > start) ?
@@ -5215,10 +5214,10 @@ static int ext4_try_to_trim_range(struct super_block *sb,
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;