diff options
author | Marcos Paulo de Souza | 2021-08-01 20:35:49 -0300 |
---|---|---|
committer | David Sterba | 2021-10-25 21:17:16 +0200 |
commit | 0e3dd5bce80f084ead392e4adc997c75605d1df5 (patch) | |
tree | 1d539455b35275b7f0a301cfe8670e91b26e2183 | |
parent | f6f39f7a0add4e7fd120a709545b57586a1d0393 (diff) |
btrfs: send: simplify send_create_inode_if_needed
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>
-rw-r--r-- | fs/btrfs/send.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 72f9b865e847..afdcbe7844e0 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -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 { |