diff mbox series

[22/26] btrfs: send: simplify return logic from process_changed_xattr()

Message ID 4f86d440ff6e3975d86df4e119259d2bc4f3301d.1739965104.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. 19, 2025, 11:43 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 | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index e29b5a5ccdd6..0cbc8b5b6fab 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -5067,17 +5067,15 @@  static int __process_changed_deleted_xattr(int num, struct btrfs_key *di_key,
 
 static int process_changed_xattr(struct send_ctx *sctx)
 {
-	int ret = 0;
+	int ret;
 
 	ret = iterate_dir_item(sctx->send_root, sctx->left_path,
 			__process_changed_new_xattr, sctx);
 	if (ret < 0)
-		goto out;
-	ret = iterate_dir_item(sctx->parent_root, sctx->right_path,
-			__process_changed_deleted_xattr, sctx);
+		return ret;
 
-out:
-	return ret;
+	return iterate_dir_item(sctx->parent_root, sctx->right_path,
+				__process_changed_deleted_xattr, sctx);
 }
 
 static int process_all_new_xattrs(struct send_ctx *sctx)