From: Badari Pulavarty <pbadari@us.ibm.com>

The problem is, if we increase our readhead size arbitrarily (say 2M), we
call mpage_readpages() with 2M and when it tries to allocated a bio enough to
fit 2M it fails, then we kick it back to "confused" code - which does 4K at
a time.

The fix is to ask for the maxium the driver can handle.
DESC
mpage_readpage-unable-to-handle-bigger-requests warning fix
EDESC

fs/mpage.c: In function `do_mpage_readpage':
fs/mpage.c:293: warning: comparison of distinct pointer types lacks a cast

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/mpage.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff -puN fs/mpage.c~mpage_readpage-unable-to-handle-bigger-requests fs/mpage.c
--- 25/fs/mpage.c~mpage_readpage-unable-to-handle-bigger-requests	Mon Aug 16 16:24:30 2004
+++ 25-akpm/fs/mpage.c	Mon Aug 16 16:24:33 2004
@@ -290,7 +290,8 @@ do_mpage_readpage(struct bio *bio, struc
 alloc_new:
 	if (bio == NULL) {
 		bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9),
-					nr_pages, GFP_KERNEL);
+			  	min_t(int, nr_pages, bio_get_nr_vecs(bdev)),
+				GFP_KERNEL);
 		if (bio == NULL)
 			goto confused;
 	}
_