Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp917532rwl; Fri, 7 Apr 2023 07:21:04 -0700 (PDT) X-Google-Smtp-Source: AKy350YS8LcbtvxB32WI18HQoGo+QJaolxyF5kmKKWy/5Dr9sotp5TXd5CiNF6nUIMW7Tmv1BlfT X-Received: by 2002:a17:906:813:b0:92b:69cd:34c7 with SMTP id e19-20020a170906081300b0092b69cd34c7mr2086022ejd.40.1680877263822; Fri, 07 Apr 2023 07:21:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680877263; cv=none; d=google.com; s=arc-20160816; b=n7V0ontqAZZN2vQq2CAGoXw4XAOhaVCm29rZnsdKpihxBxoojjOdcQjMsDP5OzdNCX mqbJWve0fQs6mrCFdKrwbCtjp1XuH29JPghLgRZNJEuNRs4QJ2Lp6HgzOPib9llpuY+m mYQYyo8Oqv0Y8lBCHBo3nWQNvJY9KIkwuDDFYJh7hYaaP1fy+nIOZlomEFMvgHxrBXRq M/UZEiKXwWFjwRLmhsZF1QIBbMuMVTfVst0yjm298mZgu4KQ37Kj4gJZJAAWqRhFu2SJ ZXnNBNBG6kV93COl1qwpyNRb8olIRlKzseEcgAXaXXwJhNJ2UpnPOOzW2YEap+QsZgp4 /amw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=f7MGhLbCXsgcUDNvyz6948H9nnYbJiCdkG7GYS5I9CA=; b=sAzdwYbpsQP+60E1PerhtonjGW6kZo8UpyP1rqhNEiR7cRnw79WKmr8fF/2PIIHn2H xgFdHMJ/OAvjMN86C91KVSrIqJsYF/Ue7kT4EiYgngr0tOSWWHaDfnanFDUNY8WtLGXa 4EtgDyQpH4CQwgVMmgqmpwmwjFxBoXoBTVIWh6PCxI5z3PXS32ZlnJazFn8Y9gCtKP7o RrbsId8nBDgH5wsmTZNid3yqY3NGYc27J94UwaBYmdhEjmQqQ8g1RkkoOXgl5WCKi7tR Duuv/bAppCTUcID1pTvpg7y4NSnAvKyWMvE4ZvdS4POTRNx6rLw634DpgzybYn2tu3l4 ZvRw== 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 lz14-20020a170906fb0e00b009354355ed33si3363526ejb.81.2023.04.07.07.20.38; Fri, 07 Apr 2023 07:21:03 -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 S240283AbjDGOR3 (ORCPT + 99 others); Fri, 7 Apr 2023 10:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231715AbjDGORU (ORCPT ); Fri, 7 Apr 2023 10:17:20 -0400 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05E016EB7 for ; Fri, 7 Apr 2023 07:17:18 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0VfXA6.c_1680877034; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0VfXA6.c_1680877034) by smtp.aliyun-inc.com; Fri, 07 Apr 2023 22:17:14 +0800 From: Jingbo Xu To: xiang@kernel.org, chao@kernel.org, huyue2@coolpad.com, linux-erofs@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/7] erofs: move packed inode out of the compression part Date: Fri, 7 Apr 2023 22:17:06 +0800 Message-Id: <20230407141710.113882-4-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20230407141710.113882-1-jefflexu@linux.alibaba.com> References: <20230407141710.113882-1-jefflexu@linux.alibaba.com> 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 packed inode could be used in more scenarios which are independent of compression in the future. For example, packed inode could be used to keep extra long xattr prefixes with the help of following patches. Signed-off-by: Jingbo Xu --- fs/erofs/internal.h | 2 +- fs/erofs/super.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index caea9dc1cd82..8b5168f94dd2 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -134,8 +134,8 @@ struct erofs_sb_info { struct inode *managed_cache; struct erofs_sb_lz4_info lz4; - struct inode *packed_inode; #endif /* CONFIG_EROFS_FS_ZIP */ + struct inode *packed_inode; struct erofs_dev_context *devs; struct dax_device *dax_dev; u64 dax_part_off; diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 325602820dc8..8f2f8433db61 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -810,7 +810,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) erofs_shrinker_register(sb); /* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ -#ifdef CONFIG_EROFS_FS_ZIP if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) { sbi->packed_inode = erofs_iget(sb, sbi->packed_nid); if (IS_ERR(sbi->packed_inode)) { @@ -819,7 +818,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) return err; } } -#endif err = erofs_init_managed_cache(sb); if (err) return err; @@ -986,9 +984,9 @@ static void erofs_put_super(struct super_block *sb) #ifdef CONFIG_EROFS_FS_ZIP iput(sbi->managed_cache); sbi->managed_cache = NULL; +#endif iput(sbi->packed_inode); sbi->packed_inode = NULL; -#endif erofs_free_dev_context(sbi->devs); sbi->devs = NULL; erofs_fscache_unregister_fs(sb); -- 2.19.1.6.gb485710b