Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5281990rwl; Tue, 11 Apr 2023 03:13:24 -0700 (PDT) X-Google-Smtp-Source: AKy350Z2lvmvWzHRQSfOa1yIcsdiGF90XEyqUDfSkDs23ELWxxhRQC9LWIRwQ8Jn1oft6vcPfVFZ X-Received: by 2002:a17:907:7e95:b0:94a:88aa:93b3 with SMTP id qb21-20020a1709077e9500b0094a88aa93b3mr6744059ejc.44.1681208004237; Tue, 11 Apr 2023 03:13:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681208004; cv=none; d=google.com; s=arc-20160816; b=U55ZweqA7t82OOvervRvHJ8mT4RXaGNqtY+0shfn5vSG3LK7ymbP4gAsqRnsAUrbv0 +lcJkYxvhGvvwaslzNaBapMOD7GyIJ0eP/DuIbvUP11Q3C6z2bu2Wy8JAHYwlnky+OZS WTErYIINTCtRnr+Tu6D1L+GOiqBd5GlmQyWtWcIcnaQnnZsc4kSvRai1FAnIiO2u1bNY hLt2Pjuvyg4APmtcbAZApM5Y4wLm0JdURTEuyrk0gZ22CNFQKNacGY7XQfl8JQjFXKkO Q7MLFLwGga3sfqPizlUXDuQcQO6uWbKrouvAYore4VJImeeUPHItNHhe8ldOAkH+H8Lw Hl6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=/N90yuN96VEsnFDOUCdhnRtMVI+zYO5goZpJsSofrKc=; b=pop9PHoLUgQs98wZuQ39VsYXemqnIcxUb+Hp8FAhMjf6wV7iCWxhb9ZX3ZbMudB1tE BC6QCxLy30nCXQ5lHcXCu0Pk66wJLECY8ba6MmjJQY7oYBT62vpuEmxTq2tFs9vXxKwS +DJZ4N3Nuk5ilm22zpohli3vR9yQ9Va9GK7fQ6N/LNPyhuKJiYlo+cHZv+ManuBXSzJO gRBtZInk9b3RkirwG674aX9T0NfXbJ6rHC1zDrqtDkV8+cXpw2u76X1R86W7q6L68VsV vtA8be5Nf7cqfKfsmcb5n0gZ+le/SFQdHmLCXMkNf53hPgOeQhaU8HLgmNUr1juBRBPS Xzzw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id la20-20020a170907781400b0093ae5807239si10798519ejc.71.2023.04.11.03.12.59; Tue, 11 Apr 2023 03:13:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229513AbjDKKLF (ORCPT + 99 others); Tue, 11 Apr 2023 06:11:05 -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: 8bit X-Spam-Status: No, score=-8.0 required=5.0 tests=ENV_AND_HDR_SPF_MATCH, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) if (erofs_inode_is_data_compressed(vi->datalayout)) { if (!erofs_is_fscache_mode(inode->i_sb) && - inode->i_sb->s_blocksize_bits == PAGE_SHIFT) - err = z_erofs_fill_inode(inode); - else + inode->i_sb->s_blocksize_bits == PAGE_SHIFT) { + inode->i_mapping->a_ops = &z_erofs_aops; + err = 0; + } else { err = -EOPNOTSUPP; + } goto out_unlock; } inode->i_mapping->a_ops = &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 -EOPNOTSUPP; } #endif /* !CONFIG_EROFS_FS_ZIP */ #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 -int z_erofs_fill_inode(struct inode *inode) -{ - struct erofs_inode *const vi = EROFS_I(inode); - struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb); - - if (!erofs_sb_has_big_pcluster(sbi) && - !erofs_sb_has_ztailpacking(sbi) && !erofs_sb_has_fragments(sbi) && - vi->datalayout == EROFS_INODE_COMPRESSED_FULL) { - vi->z_advise = 0; - vi->z_algorithmtype[0] = 0; - vi->z_algorithmtype[1] = 0; - vi->z_logical_clusterbits = inode->i_sb->s_blocksize_bits; - set_bit(EROFS_I_Z_INITED_BIT, &vi->flags); - } - inode->i_mapping->a_ops = &z_erofs_aops; - return 0; -} - struct z_erofs_maprecorder { struct inode *inode; struct erofs_map_blocks *map; -- 2.24.4