mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Gu Zheng <guz.fnst@cn.fujitsu.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>,
	fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] fs/direct-io: remove redundant comparison
Date: Fri, 21 Feb 2014 10:03:29 -0500	[thread overview]
Message-ID: <x49ob20a4ou.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <530726BB.1040308@cn.fujitsu.com> (Gu Zheng's message of "Fri, 21 Feb 2014 18:13:15 +0800")

Gu Zheng <guz.fnst@cn.fujitsu.com> writes:

> The return value of bio_get_nr_vecs() can not bigger than BIO_MAX_PAGES,
> so we can remove redundant the comparison between nr_pages and
> BIO_MAX_PAGES.

Yeah, commit f908ee94 (bio allocation failure due to bio_get_nr_vecs())
added that bounding.

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

>
> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
> ---
>  fs/direct-io.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/fs/direct-io.c b/fs/direct-io.c
> index 160a548..6e6bff3 100644
> --- a/fs/direct-io.c
> +++ b/fs/direct-io.c
> @@ -664,7 +664,6 @@ static inline int dio_new_bio(struct dio *dio, struct dio_submit *sdio,
>  		goto out;
>  	sector = start_sector << (sdio->blkbits - 9);
>  	nr_pages = min(sdio->pages_in_io, bio_get_nr_vecs(map_bh->b_bdev));
> -	nr_pages = min(nr_pages, BIO_MAX_PAGES);
>  	BUG_ON(nr_pages <= 0);
>  	dio_bio_alloc(dio, sdio, map_bh->b_bdev, sector, nr_pages);
>  	sdio->boundary = 0;

      reply	other threads:[~2014-02-21 15:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-21 10:13 Gu Zheng
2014-02-21 15:03 ` Jeff Moyer [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=x49ob20a4ou.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®