提交 f4d4e5fc 编写于 作者: Y Yue Hu 提交者: Gao Xiang

erofs: directly use wrapper erofs_page_is_managed() when shrinking

We already have the wrapper function to identify managed page.

Link: https://lore.kernel.org/r/20210810065450.1320-1-zbestahu@gmail.comReviewed-by: NGao Xiang <hsiangkao@linux.alibaba.com>
Reviewed-by: NChao Yu <chao@kernel.org>
Signed-off-by: NYue Hu <huyue2@yulong.com>
Signed-off-by: NGao Xiang <hsiangkao@linux.alibaba.com>
上级 771c994e
...@@ -309,7 +309,6 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi, ...@@ -309,7 +309,6 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
{ {
struct z_erofs_pcluster *const pcl = struct z_erofs_pcluster *const pcl =
container_of(grp, struct z_erofs_pcluster, obj); container_of(grp, struct z_erofs_pcluster, obj);
struct address_space *const mapping = MNGD_MAPPING(sbi);
int i; int i;
/* /*
...@@ -326,7 +325,7 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi, ...@@ -326,7 +325,7 @@ int erofs_try_to_free_all_cached_pages(struct erofs_sb_info *sbi,
if (!trylock_page(page)) if (!trylock_page(page))
return -EBUSY; return -EBUSY;
if (page->mapping != mapping) if (!erofs_page_is_managed(sbi, page))
continue; continue;
/* barrier is implied in the following 'unlock_page' */ /* barrier is implied in the following 'unlock_page' */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册