mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
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>
This commit is contained in:
committed by
Jens Axboe
parent
94d4bffdda
commit
5f7136db82
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user