]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: send: simplify return logic from get_cur_inode_state()
authorFilipe Manana <fdmanana@suse.com>
Mon, 10 Feb 2025 11:46:26 +0000 (11:46 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:45 +0000 (20:35 +0100)
There is no need to have an 'out' label and jump into it since there are
no resource cleanups to perform (release locks, free memory, etc), so
make this simpler by removing the label and goto and instead return
directly.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c

index 0a908e1066a6f4f572dcd6b0bce6799eca23a5db..e0e24ac94aac8d47e542a1c4300a4208d2c1d49d 100644 (file)
@@ -1880,7 +1880,7 @@ static int get_cur_inode_state(struct send_ctx *sctx, u64 ino, u64 gen,
 
        ret = get_inode_info(sctx->send_root, ino, &info);
        if (ret < 0 && ret != -ENOENT)
-               goto out;
+               return ret;
        left_ret = (info.nlink == 0) ? -ENOENT : ret;
        left_gen = info.gen;
        if (send_gen)
@@ -1891,7 +1891,7 @@ static int get_cur_inode_state(struct send_ctx *sctx, u64 ino, u64 gen,
        } else {
                ret = get_inode_info(sctx->parent_root, ino, &info);
                if (ret < 0 && ret != -ENOENT)
-                       goto out;
+                       return ret;
                right_ret = (info.nlink == 0) ? -ENOENT : ret;
                right_gen = info.gen;
                if (parent_gen)
@@ -1936,7 +1936,6 @@ static int get_cur_inode_state(struct send_ctx *sctx, u64 ino, u64 gen,
                ret = -ENOENT;
        }
 
-out:
        return ret;
 }