From nobody Fri Sep 12 15:56:42 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAB89C61DA4 for ; Thu, 9 Feb 2023 06:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229781AbjBIGkM (ORCPT ); Thu, 9 Feb 2023 01:40:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjBIGkI (ORCPT ); Thu, 9 Feb 2023 01:40:08 -0500 Received: from out30-100.freemail.mail.aliyun.com (out30-100.freemail.mail.aliyun.com [115.124.30.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03BC143441 for ; Wed, 8 Feb 2023 22:39:35 -0800 (PST) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0VbEsQkE_1675924754; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VbEsQkE_1675924754) by smtp.aliyun-inc.com; Thu, 09 Feb 2023 14:39:15 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, zhujia.zj@bytedance.com Cc: huyue2@coolpad.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/4] erofs: remove unused device mapping in meta routine Date: Thu, 9 Feb 2023 14:39:10 +0800 Message-Id: <20230209063913.46341-2-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230209063913.46341-1-jefflexu@linux.alibaba.com> References: <20230209063913.46341-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Jia Zhu Reviewed-by: Chao Yu --- fs/erofs/fscache.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index 014e20962376..03de4dc99302 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -164,18 +164,8 @@ static int erofs_fscache_read_folios_async(struct fsca= che_cookie *cookie, static int erofs_fscache_meta_read_folio(struct file *data, struct folio *= folio) { int ret; - struct super_block *sb =3D folio_mapping(folio)->host->i_sb; + struct erofs_fscache *ctx =3D folio_mapping(folio)->host->i_private; struct erofs_fscache_request *req; - struct erofs_map_dev mdev =3D { - .m_deviceid =3D 0, - .m_pa =3D folio_pos(folio), - }; - - ret =3D erofs_map_dev(sb, &mdev); - if (ret) { - folio_unlock(folio); - return ret; - } =20 req =3D erofs_fscache_req_alloc(folio_mapping(folio), folio_pos(folio), folio_size(folio)); @@ -184,8 +174,8 @@ static int erofs_fscache_meta_read_folio(struct file *d= ata, struct folio *folio) return PTR_ERR(req); } =20 - ret =3D erofs_fscache_read_folios_async(mdev.m_fscache->cookie, - req, mdev.m_pa, folio_size(folio)); + ret =3D erofs_fscache_read_folios_async(ctx->cookie, req, + folio_pos(folio), folio_size(folio)); if (ret) req->error =3D ret; =20 @@ -469,6 +459,7 @@ struct erofs_fscache *erofs_fscache_acquire_cookie(stru= ct super_block *sb, inode->i_size =3D OFFSET_MAX; inode->i_mapping->a_ops =3D &erofs_fscache_meta_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS); + inode->i_private =3D ctx; =20 ctx->inode =3D inode; } --=20 2.19.1.6.gb485710b