diff options
Diffstat (limited to 'fs/erofs')
-rw-r--r-- | fs/erofs/data.c | 6 | ||||
-rw-r--r-- | fs/erofs/fscache.c | 16 | ||||
-rw-r--r-- | fs/erofs/super.c | 16 | ||||
-rw-r--r-- | fs/erofs/zdata.c | 7 |
4 files changed, 22 insertions, 23 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 252f4ee977d5..fbb037ba326e 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -351,9 +351,9 @@ int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, * since we dont have write or truncate flows, so no inode * locking needs to be held at the moment. */ -static int erofs_readpage(struct file *file, struct page *page) +static int erofs_read_folio(struct file *file, struct folio *folio) { - return iomap_readpage(page, &erofs_iomap_ops); + return iomap_read_folio(folio, &erofs_iomap_ops); } static void erofs_readahead(struct readahead_control *rac) @@ -408,7 +408,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) /* for uncompressed (aligned) files and raw access for other files */ const struct address_space_operations erofs_raw_access_aops = { - .readpage = erofs_readpage, + .read_folio = erofs_read_folio, .readahead = erofs_readahead, .bmap = erofs_bmap, .direct_IO = noop_direct_IO, diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 7e4417167d0b..a5cc4ed2cd0d 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -205,10 +205,9 @@ out: return ret; } -static int erofs_fscache_meta_readpage(struct file *data, struct page *page) +static int erofs_fscache_meta_read_folio(struct file *data, struct folio *folio) { int ret; - struct folio *folio = page_folio(page); struct super_block *sb = folio_mapping(folio)->host->i_sb; struct netfs_io_request *rreq; struct erofs_map_dev mdev = { @@ -232,7 +231,7 @@ out: return ret; } -static int erofs_fscache_readpage_inline(struct folio *folio, +static int erofs_fscache_read_folio_inline(struct folio *folio, struct erofs_map_blocks *map) { struct super_block *sb = folio_mapping(folio)->host->i_sb; @@ -259,9 +258,8 @@ static int erofs_fscache_readpage_inline(struct folio *folio, return 0; } -static int erofs_fscache_readpage(struct file *file, struct page *page) +static int erofs_fscache_read_folio(struct file *file, struct folio *folio) { - struct folio *folio = page_folio(page); struct inode *inode = folio_mapping(folio)->host; struct super_block *sb = inode->i_sb; struct erofs_map_blocks map; @@ -286,7 +284,7 @@ static int erofs_fscache_readpage(struct file *file, struct page *page) } if (map.m_flags & EROFS_MAP_META) { - ret = erofs_fscache_readpage_inline(folio, &map); + ret = erofs_fscache_read_folio_inline(folio, &map); goto out_uptodate; } @@ -376,7 +374,7 @@ static void erofs_fscache_readahead(struct readahead_control *rac) if (map.m_flags & EROFS_MAP_META) { struct folio *folio = readahead_folio(rac); - ret = erofs_fscache_readpage_inline(folio, &map); + ret = erofs_fscache_read_folio_inline(folio, &map); if (!ret) { folio_mark_uptodate(folio); ret = folio_size(folio); @@ -410,11 +408,11 @@ static void erofs_fscache_readahead(struct readahead_control *rac) } static const struct address_space_operations erofs_fscache_meta_aops = { - .readpage = erofs_fscache_meta_readpage, + .read_folio = erofs_fscache_meta_read_folio, }; const struct address_space_operations erofs_fscache_access_aops = { - .readpage = erofs_fscache_readpage, + .read_folio = erofs_fscache_read_folio, .readahead = erofs_fscache_readahead, }; diff --git a/fs/erofs/super.c b/fs/erofs/super.c index c6f5fa4ab244..95addc5c9d34 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -578,16 +578,16 @@ static int erofs_fc_parse_param(struct fs_context *fc, #ifdef CONFIG_EROFS_FS_ZIP static const struct address_space_operations managed_cache_aops; -static int erofs_managed_cache_releasepage(struct page *page, gfp_t gfp_mask) +static bool erofs_managed_cache_release_folio(struct folio *folio, gfp_t gfp) { - int ret = 1; /* 0 - busy */ - struct address_space *const mapping = page->mapping; + bool ret = true; + struct address_space *const mapping = folio->mapping; - DBG_BUGON(!PageLocked(page)); + DBG_BUGON(!folio_test_locked(folio)); DBG_BUGON(mapping->a_ops != &managed_cache_aops); - if (PagePrivate(page)) - ret = erofs_try_to_free_cached_page(page); + if (folio_test_private(folio)) + ret = erofs_try_to_free_cached_page(&folio->page); return ret; } @@ -608,12 +608,12 @@ static void erofs_managed_cache_invalidate_folio(struct folio *folio, DBG_BUGON(stop > folio_size(folio) || stop < length); if (offset == 0 && stop == folio_size(folio)) - while (!erofs_managed_cache_releasepage(&folio->page, GFP_NOFS)) + while (!erofs_managed_cache_release_folio(folio, GFP_NOFS)) cond_resched(); } static const struct address_space_operations managed_cache_aops = { - .releasepage = erofs_managed_cache_releasepage, + .release_folio = erofs_managed_cache_release_folio, .invalidate_folio = erofs_managed_cache_invalidate_folio, }; diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index e6dea6dfca16..95efc127b2ba 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -791,7 +791,7 @@ err_out: static bool z_erofs_get_sync_decompress_policy(struct erofs_sb_info *sbi, unsigned int readahead_pages) { - /* auto: enable for readpage, disable for readahead */ + /* auto: enable for read_folio, disable for readahead */ if ((sbi->opt.sync_decompress == EROFS_SYNC_DECOMPRESS_AUTO) && !readahead_pages) return true; @@ -1488,8 +1488,9 @@ skip: } } -static int z_erofs_readpage(struct file *file, struct page *page) +static int z_erofs_read_folio(struct file *file, struct folio *folio) { + struct page *page = &folio->page; struct inode *const inode = page->mapping->host; struct erofs_sb_info *const sbi = EROFS_I_SB(inode); struct z_erofs_decompress_frontend f = DECOMPRESS_FRONTEND_INIT(inode); @@ -1563,6 +1564,6 @@ static void z_erofs_readahead(struct readahead_control *rac) } const struct address_space_operations z_erofs_aops = { - .readpage = z_erofs_readpage, + .read_folio = z_erofs_read_folio, .readahead = z_erofs_readahead, }; |