Skip to content

Commit

Permalink
erofs: directly use wrapper erofs_page_is_managed() when shrinking
Browse files Browse the repository at this point in the history
We already have the wrapper function to identify managed page.

Link: https://lore.kernel.org/r/20210810065450.1320-1-zbestahu@gmail.com
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Yue Hu <huyue2@yulong.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
  • Loading branch information
Yue Hu authored and Gao Xiang committed Aug 11, 2021
1 parent 771c994 commit f4d4e5f
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/erofs/zdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
{
struct z_erofs_pcluster *const pcl =
container_of(grp, struct z_erofs_pcluster, obj);
struct address_space *const mapping = MNGD_MAPPING(sbi);
int i;

/*
Expand All @@ -326,7 +325,7 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
if (!trylock_page(page))
return -EBUSY;

if (page->mapping != mapping)
if (!erofs_page_is_managed(sbi, page))
continue;

/* barrier is implied in the following 'unlock_page' */
Expand Down

0 comments on commit f4d4e5f

Please sign in to comment.