diff options
author | Matthew Wilcox (Oracle) <willy@infradead.org> | 2021-01-29 04:38:57 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-26 15:49:51 -0700 |
commit | 5f7136db82996089cdfb2939c7664b29e9da141d (patch) | |
tree | f6fb9ac2dafb2ca03002f6c86bc0fb1062fadcfa /fs/mpage.c | |
parent | 94d4bffdda21baa2c749bc229c41811a7559dd15 (diff) |
block: Add bio_max_segs
It's often inconvenient to use BIO_MAX_PAGES due to min() requiring the
sign to be the same. Introduce bio_max_segs() and change BIO_MAX_PAGES to
be unsigned to make it easier for the users.
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/mpage.c')
-rw-r--r-- | fs/mpage.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/mpage.c b/fs/mpage.c index 830e6cc2a9e7..961234d68779 100644 --- a/fs/mpage.c +++ b/fs/mpage.c @@ -304,9 +304,7 @@ alloc_new: goto out; } args->bio = mpage_alloc(bdev, blocks[0] << (blkbits - 9), - min_t(int, args->nr_pages, - BIO_MAX_PAGES), - gfp); + bio_max_segs(args->nr_pages), gfp); if (args->bio == NULL) goto confused; } |