From: Alex Elder <elder@ieee.org>
To: Zhang Zhen <zhenzhang.zhang@huawei.com>,
sage@inktank.com, ukernel@gmail.com
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] ceph: refactor readpage_nounlock() to make the logic clearer
Date: Wed, 28 May 2014 07:24:13 -0500 [thread overview]
Message-ID: <5385D56D.9030205@ieee.org> (raw)
In-Reply-To: <53858BC3.8070604@huawei.com>
On 05/28/2014 02:09 AM, Zhang Zhen wrote:
> If the return value of ceph_osdc_readpages() is not negative,
> it is certainly greater than or equal to zero.
>
> Remove the useless condition judgment and redundant braces.
>
> Signed-off-by: Zhang Zhen <zhenzhang.zhang@huawei.com>
This looks good.
Reviewed-by: Alex Elder <elder@linaro.org>
> ---
> fs/ceph/addr.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
> index b53278c..6aa2e3f 100644
> --- a/fs/ceph/addr.c
> +++ b/fs/ceph/addr.c
> @@ -211,18 +211,15 @@ static int readpage_nounlock(struct file *filp, struct page *page)
> SetPageError(page);
> ceph_fscache_readpage_cancel(inode, page);
> goto out;
> - } else {
> - if (err < PAGE_CACHE_SIZE) {
> - /* zero fill remainder of page */
> - zero_user_segment(page, err, PAGE_CACHE_SIZE);
> - } else {
> - flush_dcache_page(page);
> - }
> }
> - SetPageUptodate(page);
> + if (err < PAGE_CACHE_SIZE)
> + /* zero fill remainder of page */
> + zero_user_segment(page, err, PAGE_CACHE_SIZE);
> + else
> + flush_dcache_page(page);
>
> - if (err >= 0)
> - ceph_readpage_to_fscache(inode, page);
> + SetPageUptodate(page);
> + ceph_readpage_to_fscache(inode, page);
>
> out:
> return err < 0 ? err : 0;
>
prev parent reply other threads:[~2014-05-28 12:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1401260798-28541-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-05-28 7:09 ` [PATCH] ceph: refactor readpage_nounlock() to make the logic clearer Zhang Zhen
2014-05-28 9:08 ` Yan, Zheng
2014-05-28 12:24 ` Alex Elder [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=5385D56D.9030205@ieee.org \
--to=elder@ieee.org \
--cc=ceph-devel@vger.kernel.org \
--cc=sage@inktank.com \
--cc=ukernel@gmail.com \
--cc=zhenzhang.zhang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.