From: Filipe Manana Date: Tue, 18 Feb 2025 15:44:13 +0000 (+0000) Subject: btrfs: send: simplify return logic from record_new_ref_if_needed() X-Git-Tag: v6.15-rc1~152^2~99 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=25e5dee510a75e01a55f113e6411ff2b1c99e73c;p=thirdparty%2Flinux.git btrfs: send: simplify return logic from record_new_ref_if_needed() 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 5fd3deaf14d60..96aa519e791ac 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -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; }