]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: send: simplify send_create_inode_if_needed
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Sun, 1 Aug 2021 23:35:49 +0000 (20:35 -0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Oct 2021 19:17:16 +0000 (21:17 +0200)
The out label is being overused, we can simply return if the condition
permits.

No functional changes.

Reviewed-by: Su Yue <l@damenly.su>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/send.c

index 72f9b865e84790fdb6e4187ad82e271999961abc..afdcbe7844e0e3d7a984ef5f57c9ecf5cc13be27 100644 (file)
@@ -2720,19 +2720,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;
+               else 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 {