diff mbox series

[v2,18/30] btrfs: send: simplify return logic from record_new_ref()

Message ID 56ddd47f9ff5493137cc6ec668ff7b97413068b1.1740049233.git.fdmanana@suse.com (mailing list archive)
State New
Headers show
Series btrfs: avoid repeated path computations and allocations for send | expand

Commit Message

Filipe Manana Feb. 20, 2025, 11:04 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

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>
---
 fs/btrfs/send.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index b715557ec720..181a234e3a5e 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -4746,11 +4746,9 @@  static int record_new_ref(struct send_ctx *sctx)
 	ret = iterate_inode_ref(sctx->send_root, sctx->left_path,
 				sctx->cmp_key, 0, record_new_ref_if_needed, sctx);
 	if (ret < 0)
-		goto out;
-	ret = 0;
+		return ret;
 
-out:
-	return ret;
+	return 0;
 }
 
 static int record_deleted_ref(struct send_ctx *sctx)