From: Jingbo Xu jefflexu@linux.alibaba.com
mainline inclusion from mainline-v6.3-rc1 commit bdfa90142eb1f1272d2efc00dda6c0f35814e36a category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT
--------------------------------
Currently metadata is always on bootstrap, and thus device mapping is not needed so far. Remove the redundant device mapping in the meta routine.
Signed-off-by: Jingbo Xu jefflexu@linux.alibaba.com Reviewed-by: Jia Zhu zhujia.zj@bytedance.com Reviewed-by: Chao Yu chao@kernel.org Link: https://lore.kernel.org/r/20230209063913.46341-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang hsiangkao@linux.alibaba.com
Conflicts: fs/erofs/fscache.c [ Because it hasn't been switched to folio yet. ] Signed-off-by: Baokun Li libaokun1@huawei.com --- fs/erofs/fscache.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 17640adf574d..23b55a67feb5 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -57,16 +57,9 @@ static int erofs_fscache_meta_readpage(struct file *data, struct page *page) { int ret; struct super_block *sb = page->mapping->host->i_sb; - struct erofs_map_dev mdev = { - .m_deviceid = 0, - .m_pa = page_offset(page), - }; - - ret = erofs_map_dev(sb, &mdev); - if (ret) - goto out; + struct erofs_fscache *ctx = page->mapping->host->i_private;
- ret = fscache_read_or_alloc_page(mdev.m_fscache->cookie, page, + ret = fscache_read_or_alloc_page(ctx->cookie, page, erofs_readpage_from_fscache_complete, NULL, GFP_KERNEL); @@ -423,6 +416,7 @@ struct erofs_fscache *erofs_fscache_acquire_cookie(struct super_block *sb, inode->i_size = OFFSET_MAX; inode->i_mapping->a_ops = &erofs_fscache_meta_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); + inode->i_private = ctx;
ctx->inode = inode; }