mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +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
@@ -695,7 +695,7 @@ static inline int dio_new_bio(struct dio *dio, struct dio_submit *sdio,
|
||||
if (ret)
|
||||
goto out;
|
||||
sector = start_sector << (sdio->blkbits - 9);
|
||||
nr_pages = min(sdio->pages_in_io, BIO_MAX_PAGES);
|
||||
nr_pages = bio_max_segs(sdio->pages_in_io);
|
||||
BUG_ON(nr_pages <= 0);
|
||||
dio_bio_alloc(dio, sdio, map_bh->b_bdev, sector, nr_pages);
|
||||
sdio->boundary = 0;
|
||||
|
Reference in New Issue
Block a user