From: Jan Kara <jack@suse.cz>
To: Weitao Hou <houweitaoo@gmail.com>
Cc: tytso@mit.edu, adilger.kernel@dilger.ca,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ext4: use rb_entry_safe() instead of open-coding it
Date: Fri, 2 Aug 2019 13:02:33 +0200 [thread overview]
Message-ID: <20190802110233.GB9339@quack2.suse.cz> (raw)
In-Reply-To: <20190725131658.17187-1-houweitaoo@gmail.com>
On Thu 25-07-19 21:16:58, Weitao Hou wrote:
> use rb_entry_safe() to make it clean
>
> Signed-off-by: Weitao Hou <houweitaoo@gmail.com>
Thanks for the patch. It looks good. You can add:
Reviewed-by: Jan Kara <jack@suse.cz>
Honza
> ---
> fs/ext4/extents_status.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext4/extents_status.c b/fs/ext4/extents_status.c
> index 7521de2dcf3a..08ce5ded3538 100644
> --- a/fs/ext4/extents_status.c
> +++ b/fs/ext4/extents_status.c
> @@ -228,8 +228,7 @@ static struct extent_status *__es_tree_search(struct rb_root *root,
>
> if (es && lblk > ext4_es_end(es)) {
> node = rb_next(&es->rb_node);
> - return node ? rb_entry(node, struct extent_status, rb_node) :
> - NULL;
> + return rb_entry_safe(node, struct extent_status, rb_node);
> }
>
> return NULL;
> --
> 2.18.0
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
prev parent reply other threads:[~2019-08-02 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-25 13:16 [PATCH] ext4: use rb_entry_safe() instead of open-coding it Weitao Hou
2019-08-02 11:02 ` Jan Kara [this message]
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=20190802110233.GB9339@quack2.suse.cz \
--to=jack@suse.cz \
--cc=adilger.kernel@dilger.ca \
--cc=houweitaoo@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tytso@mit.edu \
/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).