[PATCH 4/5] block/bdev: enable large folio support for large logical block sizes
hare at kernel.org
hare at kernel.org
Fri May 10 03:29:05 PDT 2024
From: Hannes Reinecke <hare at suse.de>
Call mapping_set_folio_min_order() when modifying the logical block
size to ensure folios are allocated with the correct size.
Signed-off-by: Hannes Reinecke <hare at suse.de>
---
block/bdev.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block/bdev.c b/block/bdev.c
index d37aa51b99ed..a0c0ecc886e8 100644
--- a/block/bdev.c
+++ b/block/bdev.c
@@ -142,6 +142,8 @@ static void set_init_blocksize(struct block_device *bdev)
bsize <<= 1;
}
bdev->bd_inode->i_blkbits = blksize_bits(bsize);
+ mapping_set_folio_min_order(bdev->bd_inode->i_mapping,
+ get_order(bsize));
}
int set_blocksize(struct block_device *bdev, int size)
@@ -158,6 +160,8 @@ int set_blocksize(struct block_device *bdev, int size)
if (bdev->bd_inode->i_blkbits != blksize_bits(size)) {
sync_blockdev(bdev);
bdev->bd_inode->i_blkbits = blksize_bits(size);
+ mapping_set_folio_min_order(bdev->bd_inode->i_mapping,
+ get_order(size));
kill_bdev(bdev);
}
return 0;
--
2.35.3
More information about the Linux-nvme
mailing list