[PATCH 16/28] fuse: implement large folios for iomap pagecache files

Darrick J. Wong
2025-09-16T00:32:09Z

Use large folios when we're using iomap.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
fs/fuse/file_iomap.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/fs/fuse/file_iomap.c b/fs/fuse/file_iomap.c
index d771b1068fb912..c09e00c7de2694 100644
--- a/fs/fuse/file_iomap.c
+++ b/fs/fuse/file_iomap.c
@@ -1357,6 +1357,7 @@ static const struct address_space_operations fuse_iomap_aops = {
static inline void fuse_inode_set_iomap(struct inode *inode)
{
struct fuse_inode *fi = get_fuse_inode(inode);
+ unsigned int min_order = 0;

ASSERT(fuse_has_iomap(inode));

@@ -1365,6 +1366,11 @@ static inline void fuse_inode_set_iomap(struct inode *inode)
INIT_WORK(&fi->ioend_work, fuse_iomap_end_io);
INIT_LIST_HEAD(&fi->ioend_list);
spin_lock_init(&fi->ioend_lock);
+
+ if (inode->i_blkbits > PAGE_SHIFT)
+ min_order = inode->i_blkbits - PAGE_SHIFT;
+
+ mapping_set_folio_min_order(inode->i_mapping, min_order);
set_bit(FUSE_I_IOMAP, &fi->state);
}