From: Su Yue <l@damenly.su>
To: Marcos Paulo de Souza <mpdesouza@suse.com>
Cc: linux-btrfs@vger.kernel.org, dsterba@suse.com, fdmanana@suse.com
Subject: Re: [PATCH] btrfs: send: Simplify send_create_inode_if_needed
Date: Mon, 02 Aug 2021 07:55:03 +0800 [thread overview]
Message-ID: <7dh43ekh.fsf@damenly.su> (raw)
In-Reply-To: <20210801233549.25480-1-mpdesouza@suse.com>
On Mon 02 Aug 2021 at 07:35, Marcos Paulo de Souza
<mpdesouza@suse.com> 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 <mpdesouza@suse.com>
>
Reviewed-by: Su Yue <l@damenly.su>
--
Su
> ---
> 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 {
next prev parent reply other threads:[~2021-08-01 23:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-01 23:35 [PATCH] btrfs: send: Simplify send_create_inode_if_needed Marcos Paulo de Souza
2021-08-01 23:55 ` Su Yue [this message]
2021-08-02 7:39 ` Nikolay Borisov
2021-08-02 11:59 ` Marcos Paulo de Souza
2021-08-19 12:38 ` David Sterba
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7dh43ekh.fsf@damenly.su \
--to=l@damenly.su \
--cc=dsterba@suse.com \
--cc=fdmanana@suse.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=mpdesouza@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).