]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: send: simplify return logic from send_rename()
authorFilipe Manana <fdmanana@suse.com>
Thu, 20 Feb 2025 10:57:05 +0000 (10:57 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 18 Mar 2025 19:35:46 +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 f161e6a695bd1211faea8abd807bebf9677e0df7..d5c151651d07c7f45f373328e39110971e3bfa9b 100644 (file)
@@ -809,7 +809,7 @@ static int send_rename(struct send_ctx *sctx,
 
        ret = begin_cmd(sctx, BTRFS_SEND_C_RENAME);
        if (ret < 0)
-               goto out;
+               return ret;
 
        TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH, from);
        TLV_PUT_PATH(sctx, BTRFS_SEND_A_PATH_TO, to);
@@ -817,7 +817,6 @@ static int send_rename(struct send_ctx *sctx,
        ret = send_cmd(sctx);
 
 tlv_put_failure:
-out:
        return ret;
 }