]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: send: simplify return logic from record_new_ref_if_needed()
authorFilipe Manana <fdmanana@suse.com>
Tue, 18 Feb 2025 15:44:13 +0000 (15:44 +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 5fd3deaf14d6042f963fa8095e45f80fdf160bb2..96aa519e791ac54b101fe5551051e59a05a8cf97 100644 (file)
@@ -4683,7 +4683,7 @@ out:
 
 static int record_new_ref_if_needed(u64 dir, struct fs_path *name, void *ctx)
 {
-       int ret = 0;
+       int ret;
        struct send_ctx *sctx = ctx;
        struct rb_node *node = NULL;
        struct recorded_ref data;
@@ -4692,7 +4692,7 @@ static int record_new_ref_if_needed(u64 dir, struct fs_path *name, void *ctx)
 
        ret = get_inode_gen(sctx->send_root, dir, &dir_gen);
        if (ret < 0)
-               goto out;
+               return ret;
 
        data.dir = dir;
        data.dir_gen = dir_gen;
@@ -4706,7 +4706,7 @@ static int record_new_ref_if_needed(u64 dir, struct fs_path *name, void *ctx)
                                         &sctx->new_refs, name, dir, dir_gen,
                                         sctx);
        }
-out:
+
        return ret;
 }