Skip to content

Commit 8c5de05

Browse files
author
Matthew Wilcox (Oracle)
committed
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>
1 parent eef15ea commit 8c5de05

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

fs/erofs/super.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -518,16 +518,16 @@ static int erofs_fc_parse_param(struct fs_context *fc,
518518
#ifdef CONFIG_EROFS_FS_ZIP
519519
static const struct address_space_operations managed_cache_aops;
520520

521-
static int erofs_managed_cache_releasepage(struct page *page, gfp_t gfp_mask)
521+
static bool erofs_managed_cache_release_folio(struct folio *folio, gfp_t gfp)
522522
{
523-
int ret = 1; /* 0 - busy */
524-
struct address_space *const mapping = page->mapping;
523+
bool ret = true;
524+
struct address_space *const mapping = folio->mapping;
525525

526-
DBG_BUGON(!PageLocked(page));
526+
DBG_BUGON(!folio_test_locked(folio));
527527
DBG_BUGON(mapping->a_ops != &managed_cache_aops);
528528

529-
if (PagePrivate(page))
530-
ret = erofs_try_to_free_cached_page(page);
529+
if (folio_test_private(folio))
530+
ret = erofs_try_to_free_cached_page(&folio->page);
531531

532532
return ret;
533533
}
@@ -548,12 +548,12 @@ static void erofs_managed_cache_invalidate_folio(struct folio *folio,
548548
DBG_BUGON(stop > folio_size(folio) || stop < length);
549549

550550
if (offset == 0 && stop == folio_size(folio))
551-
while (!erofs_managed_cache_releasepage(&folio->page, GFP_NOFS))
551+
while (!erofs_managed_cache_release_folio(folio, GFP_NOFS))
552552
cond_resched();
553553
}
554554

555555
static const struct address_space_operations managed_cache_aops = {
556-
.releasepage = erofs_managed_cache_releasepage,
556+
.release_folio = erofs_managed_cache_release_folio,
557557
.invalidate_folio = erofs_managed_cache_invalidate_folio,
558558
};
559559

0 commit comments

Comments
 (0)