public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/direct-io: remove redundant comparison
@ 2014-02-21 10:13 Gu Zheng
  2014-02-21 15:03 ` Jeff Moyer
  0 siblings, 1 reply; 2+ messages in thread
From: Gu Zheng @ 2014-02-21 10:13 UTC (permalink / raw)
  To: Al Viro; +Cc: fsdevel, linux-kernel, Andrew Morton

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.

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;
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/direct-io: remove redundant comparison
  2014-02-21 10:13 [PATCH] fs/direct-io: remove redundant comparison Gu Zheng
@ 2014-02-21 15:03 ` Jeff Moyer
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Moyer @ 2014-02-21 15:03 UTC (permalink / raw)
  To: Gu Zheng; +Cc: Al Viro, fsdevel, linux-kernel, Andrew Morton

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;

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-21 15:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21 10:13 [PATCH] fs/direct-io: remove redundant comparison Gu Zheng
2014-02-21 15:03 ` Jeff Moyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox