From nobody Wed Feb 11 18:10:47 2026 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 4DA98C76196 for ; Tue, 11 Apr 2023 10:11:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229548AbjDKKLG (ORCPT ); Tue, 11 Apr 2023 06:11:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229452AbjDKKLE (ORCPT ); Tue, 11 Apr 2023 06:11:04 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B1291BC8 for ; Tue, 11 Apr 2023 03:11:02 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R291e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=3;SR=0;TI=SMTPD_---0Vfrtabo_1681207847; Received: from e18g06460.et15sqa.tbsite.net(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0Vfrtabo_1681207847) by smtp.aliyun-inc.com; Tue, 11 Apr 2023 18:10:59 +0800 From: Gao Xiang To: linux-erofs@lists.ozlabs.org Cc: LKML , Gao Xiang Subject: [PATCH] erofs: get rid of z_erofs_fill_inode() Date: Tue, 11 Apr 2023 18:10:45 +0800 Message-Id: <20230411101045.35762-1-hsiangkao@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 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" Prior to big pclusters, non-compact compression indexes could have empty headers. Let's just avoid the legacy path since it can be handled properly as a specific compression header with z_erofs_fill_inode_lazy() too. Tested with erofs-utils exist versions. Signed-off-by: Gao Xiang --- fs/erofs/inode.c | 8 +++++--- fs/erofs/internal.h | 2 -- fs/erofs/zmap.c | 18 ------------------ 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index 7ca9aafb7471..4438ed5b08be 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -292,10 +292,12 @@ static int erofs_fill_inode(struct inode *inode) =20 if (erofs_inode_is_data_compressed(vi->datalayout)) { if (!erofs_is_fscache_mode(inode->i_sb) && - inode->i_sb->s_blocksize_bits =3D=3D PAGE_SHIFT) - err =3D z_erofs_fill_inode(inode); - else + inode->i_sb->s_blocksize_bits =3D=3D PAGE_SHIFT) { + inode->i_mapping->a_ops =3D &z_erofs_aops; + err =3D 0; + } else { err =3D -EOPNOTSUPP; + } goto out_unlock; } inode->i_mapping->a_ops =3D &erofs_raw_access_aops; diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index f675050af2bb..f1268cb6a37c 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -522,7 +522,6 @@ int erofs_try_to_free_cached_page(struct page *page); int z_erofs_load_lz4_config(struct super_block *sb, struct erofs_super_block *dsb, struct z_erofs_lz4_cfgs *lz4, int len); -int z_erofs_fill_inode(struct inode *inode); int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *= map, int flags); #else @@ -542,7 +541,6 @@ static inline int z_erofs_load_lz4_config(struct super_= block *sb, } return 0; } -static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOT= SUPP; } #endif /* !CONFIG_EROFS_FS_ZIP */ =20 #ifdef CONFIG_EROFS_FS_ZIP_LZMA diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c index 7ca108c3834c..14c21284d019 100644 --- a/fs/erofs/zmap.c +++ b/fs/erofs/zmap.c @@ -7,24 +7,6 @@ #include #include =20 -int z_erofs_fill_inode(struct inode *inode) -{ - struct erofs_inode *const vi =3D EROFS_I(inode); - struct erofs_sb_info *sbi =3D EROFS_SB(inode->i_sb); - - if (!erofs_sb_has_big_pcluster(sbi) && - !erofs_sb_has_ztailpacking(sbi) && !erofs_sb_has_fragments(sbi) && - vi->datalayout =3D=3D EROFS_INODE_COMPRESSED_FULL) { - vi->z_advise =3D 0; - vi->z_algorithmtype[0] =3D 0; - vi->z_algorithmtype[1] =3D 0; - vi->z_logical_clusterbits =3D inode->i_sb->s_blocksize_bits; - set_bit(EROFS_I_Z_INITED_BIT, &vi->flags); - } - inode->i_mapping->a_ops =3D &z_erofs_aops; - return 0; -} - struct z_erofs_maprecorder { struct inode *inode; struct erofs_map_blocks *map; --=20 2.24.4