Skip to content

Commit ce529cc

Browse files
lostjefflehsiangkao
authored andcommitted
erofs: enable large folios for iomap mode
Enable large folios for iomap mode. Then the readahead routine will pass down large folios containing multiple pages. Let's enable this for non-compressed format for now, until the compression part supports large folios later. When large folios supported, the iomap routine will allocate iomap_page for each large folio and thus we need iomap_release_folio() and iomap_invalidate_folio() to free iomap_page when these folios get reclaimed or invalidated. Signed-off-by: Jingbo Xu <[email protected]> Reviewed-by: Gao Xiang <[email protected]> Reviewed-by: Chao Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Gao Xiang <[email protected]>
1 parent eb70814 commit ce529cc

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

fs/erofs/data.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ const struct address_space_operations erofs_raw_access_aops = {
403403
.readahead = erofs_readahead,
404404
.bmap = erofs_bmap,
405405
.direct_IO = noop_direct_IO,
406+
.release_folio = iomap_release_folio,
407+
.invalidate_folio = iomap_invalidate_folio,
406408
};
407409

408410
#ifdef CONFIG_FS_DAX

fs/erofs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,8 @@ static int erofs_fill_inode(struct inode *inode)
295295
goto out_unlock;
296296
}
297297
inode->i_mapping->a_ops = &erofs_raw_access_aops;
298+
if (!erofs_is_fscache_mode(inode->i_sb))
299+
mapping_set_large_folios(inode->i_mapping);
298300
#ifdef CONFIG_EROFS_FS_ONDEMAND
299301
if (erofs_is_fscache_mode(inode->i_sb))
300302
inode->i_mapping->a_ops = &erofs_fscache_access_aops;

0 commit comments

Comments
 (0)