diff options
author | Matthew Wilcox (Oracle) | 2022-04-30 23:29:26 -0400 |
---|---|---|
committer | Matthew Wilcox (Oracle) | 2022-05-09 23:12:33 -0400 |
commit | 8c5de05e41d4850db271f35fe25f8dd43e4beaeb (patch) | |
tree | 3154a956ee7ec22b7a33d8a8079de92f9b3dec49 /fs/erofs | |
parent | eef15ea146f82a06487c4b1d6a545a97b0401cd3 (diff) |
erofs: Convert to release_folio
Use a folio in erofs_managed_cache_release_folio(), but use of folios
should be pushed into erofs_try_to_free_cached_page().
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Diffstat (limited to 'fs/erofs')
-rw-r--r-- | fs/erofs/super.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 0c4b41130c2f..0e3862a72bfe 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -518,16 +518,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; } @@ -548,12 +548,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, }; |