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
@@ -2747,7 +2747,7 @@ int f2fs_restore_node_summary(struct f2fs_sb_info *sbi,
|
||||
sum_entry = &sum->entries[0];
|
||||
|
||||
for (i = 0; i < last_offset; i += nrpages, addr += nrpages) {
|
||||
nrpages = min(last_offset - i, BIO_MAX_PAGES);
|
||||
nrpages = bio_max_segs(last_offset - i);
|
||||
|
||||
/* readahead node pages */
|
||||
f2fs_ra_meta_pages(sbi, addr, nrpages, META_POR, true);
|
||||
|
||||
Reference in New Issue
Block a user