Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp5091926pxb; Mon, 28 Mar 2022 07:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgf6/ygBxWz+SLGwcHwtUCpCrOnGk4KkLET8Y0HhF6BFZH7VAAZWhgOmgNU5uPbF8jlBdk X-Received: by 2002:a17:906:fd7:b0:6d6:e276:e6a5 with SMTP id c23-20020a1709060fd700b006d6e276e6a5mr27792784ejk.545.1648479067095; Mon, 28 Mar 2022 07:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648479067; cv=none; d=google.com; s=arc-20160816; b=QLqeMq2faLp76v1cnxLRPJb+qMoVlJ8ayYlh3JS9cKjXScNJ2P9xzcyUZIsZ8W1dTw troBGH10bocuHsEibZVekO3/eIxUOoqfCrvhoWCtW7ZL2b/0Og2VAUVPlB+XKMABmLCc bSNvXrefW3Gp6o9Yv/SeDGd2CkMfHUk68J3s+FtwRLgo0+Kc6Wr3Y2iPEFxTSzSN/BLu mROvhgBKa18urRu5TOL53Yig+hHKlDS9veQC/cW8gEjLyG1tXZwnQZD/gOco3uiQ74+1 rKsMAX+YGfWyuIOwtdwg0/rwfqCiGJ6C6gPefrwC6/Jjfbw20nDd1/uD2KOvS1+tnYiU DYSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=KAh1H29ZT30eGlN/vPNCFy3FT/e0K1n6zp80rdWYrTw=; b=rLCtL9ZnGRxqMrlniGXZR1qDfobLj+VJ3eWzKA3V8pL/6QxdtzL4x10gfiS4wkW2CA DZ4Ank+bQkQKgXz/qmaItUJioV3xtZrgd1ufFr66sAPPKCPHQ250OYhnxc67DgRDe79o rNrKEmUP2vOkPbSThNMkYozgNT6mmMc7886ZKnbIo0ugNoQdMZg/5kf2lSMs6uMYcpWV 2q8e3cmR1DKqxgprm4EYmgT2rGLjY7j/Q4hfoLPbIXb/8eXjUnaxcQk0T2qjMXljEcXh 0h5X7CD5MEdTjXpAKnSJHt1iYK2ngMhLehuo3daeC/1ZOXjEkiSvUS1Wypbi7u3Lp3/t SBMw== 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 e3-20020a1709061e8300b006df76385d9fsi13329341ejj.575.2022.03.28.07.50.41; Mon, 28 Mar 2022 07:51:07 -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 S237649AbiC1Coa (ORCPT + 99 others); Sun, 27 Mar 2022 22:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230198AbiC1Co2 (ORCPT ); Sun, 27 Mar 2022 22:44:28 -0400 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D81813FBC6; Sun, 27 Mar 2022 19:42:48 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R281e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=19;SR=0;TI=SMTPD_---0V8KfwCN_1648435362; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V8KfwCN_1648435362) by smtp.aliyun-inc.com(127.0.0.1); Mon, 28 Mar 2022 10:42:44 +0800 Date: Mon, 28 Mar 2022 10:42:42 +0800 From: Gao Xiang To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org, luodaowen.backend@bytedance.com, tianzichen@kuaishou.com, fannaihao@baidu.com Subject: Re: [PATCH v6 10/22] erofs: add mode checking helper Message-ID: Mail-Followup-To: Jeffle Xu , dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, torvalds@linux-foundation.org, gregkh@linuxfoundation.org, willy@infradead.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org, luodaowen.backend@bytedance.com, tianzichen@kuaishou.com, fannaihao@baidu.com References: <20220325122223.102958-1-jefflexu@linux.alibaba.com> <20220325122223.102958-11-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220325122223.102958-11-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham 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 On Fri, Mar 25, 2022 at 08:22:11PM +0800, Jeffle Xu wrote: > Until then erofs is exactly blockdev based filesystem. In other using > scenarios (e.g. container image), erofs needs to run upon files. > > This patch set is going to introduces a new nodev mode, in which erofs > could be mounted from a bootstrap blob file containing complete erofs > image. > > Add a helper checking which mode erofs works in. > > Signed-off-by: Jeffle Xu > --- > fs/erofs/internal.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h > index e424293f47a2..1486e2573667 100644 > --- a/fs/erofs/internal.h > +++ b/fs/erofs/internal.h > @@ -161,6 +161,11 @@ struct erofs_sb_info { > #define set_opt(opt, option) ((opt)->mount_opt |= EROFS_MOUNT_##option) > #define test_opt(opt, option) ((opt)->mount_opt & EROFS_MOUNT_##option) > > +static inline bool erofs_is_nodev_mode(struct super_block *sb) I've seen a lot of such + if (IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && + erofs_is_nodev_mode(sb)) { usages in the followup patches, which makes me wonder if the configuration can be checked in the helper as well. Also maybe rename it as erofs_is_fscache_mode()? Thanks, Gao Xiang > +{ > + return !sb->s_bdev; > +} > + > enum { > EROFS_ZIP_CACHE_DISABLED, > EROFS_ZIP_CACHE_READAHEAD, > -- > 2.27.0