Thread (5 messages) 5 messages, 5 authors, 2021-08-19

Re: [PATCH] btrfs: send: Simplify send_create_inode_if_needed

From: Su Yue <hidden>
Date: 2021-08-01 23:55:55

On Mon 02 Aug 2021 at 07:35, Marcos Paulo de Souza 
[off-list ref] wrote:
The out label is being overused, we can simply return if the 
condition
permits.

No functional changes.

Signed-off-by: Marcos Paulo de Souza <redacted>
Reviewed-by: Su Yue <redacted>

--
Su
quoted hunk ↗ jump to hunk
---
 fs/btrfs/send.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c
index 75cff564dedf..17cd67e41d3a 100644
--- a/fs/btrfs/send.c
+++ b/fs/btrfs/send.c
@@ -2727,19 +2727,12 @@ static int 
send_create_inode_if_needed(struct send_ctx *sctx)
 	if (S_ISDIR(sctx->cur_inode_mode)) {
 		ret = did_create_dir(sctx, sctx->cur_ino);
 		if (ret < 0)
-			goto out;
-		if (ret) {
-			ret = 0;
-			goto out;
-		}
+			return ret;
+		if (ret > 0)
+			return 0;
 	}

-	ret = send_create_inode(sctx, sctx->cur_ino);
-	if (ret < 0)
-		goto out;
-
-out:
-	return ret;
+	return send_create_inode(sctx, sctx->cur_ino);
 }

 struct recorded_ref {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help