mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-29 13:23:23 +01:00
block/bdev: enable large folio support for large logical block sizes
Call mapping_set_folio_min_order() when modifying the logical block size to ensure folios are allocated with the correct size. Reviewed-by: Luis Chamberlain <[email protected]> Reviewed-by: "Matthew Wilcox (Oracle)" <[email protected]> Signed-off-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: John Garry <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Christian Brauner <[email protected]>
This commit is contained in:
1 parent
e59e97d42b
commit
3c20917120
1 file changed
+3
@@ -148,6 +148,8 @@ static void set_init_blocksize(struct block_device *bdev)
|
||||
bsize <<= 1;
|
||||
}
|
||||
BD_INODE(bdev)->i_blkbits = blksize_bits(bsize);
|
||||
mapping_set_folio_min_order(BD_INODE(bdev)->i_mapping,
|
||||
get_order(bsize));
|
||||
}
|
||||
|
||||
int set_blocksize(struct file *file, int size)
|
||||
@@ -169,6 +171,7 @@ int set_blocksize(struct file *file, int size)
|
||||
if (inode->i_blkbits != blksize_bits(size)) {
|
||||
sync_blockdev(bdev);
|
||||
inode->i_blkbits = blksize_bits(size);
|
||||
mapping_set_folio_min_order(inode->i_mapping, get_order(size));
|
||||
kill_bdev(bdev);
|
||||
}
|
||||
return 0;
|
||||
|
||||
Reference in new issue
Block a user