Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp978283pxp; Wed, 16 Mar 2022 23:16:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxNxXldCkPfZdTVsyzFS7fHXx22yDpyNGhscLnDHDt+/reR7uUC61T5iXZ+KKDwdGwW9dGi X-Received: by 2002:a17:907:1b09:b0:6d8:faa8:4a06 with SMTP id mp9-20020a1709071b0900b006d8faa84a06mr2796459ejc.701.1647497772926; Wed, 16 Mar 2022 23:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647497772; cv=none; d=google.com; s=arc-20160816; b=zPSe5d2Clh9wflf58nb98EIYpnACZzYLjM4ljZ8n8rqt+MM5QwTFI2D/OrSz8DQFbu wf4Ox8Mu1/PWjGOvos02Yn1P/VdrBSYG5yjQJeqUgYCRXY2KV/5+zwXCp+3eKHCJWGCJ OBNQJvYeWCVOD+3+aoA5oA4VScIcFZ6f4kkkG3rSDaWM11NV4LoKpIse8B1CVE7zY3Gw J4AfJh4zkRE1jysdOeTCw68X7Kyc14rGiJk+fkI4Qz26adPKYneCLukZqHLbmfdRwIlr dj2wT0/eunl5mnFLBgVwxggv6yCIhXTfkE7E/i79XV+gQGkZXVfLmeWZcJD/Eovf2dfz yocg== 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=kBDbhXFYynD9bp1RnBbal2BeBt3w2xGxgk/PyG2gmzw=; b=YVJJm1Mkb/VubBu545aaSfqhyT3VlVJmawUnh5Qs+j/GbuLYer/Sw9lfIfEJRnTD8g oPLx7i7cQyc426+yrN3O2cdHc1tbdWVrYTe6sfPeGdgpf41BrY77RSe7oMNxRgi3CMm+ 1mKOa3yZQhJ7YEytv4fFKx0PtuogEbbTxuQGkp7XRAxqSUQYE1xBvV1VL3gNpT4yjlEC IleIvQjDXcDtHcvx3/a1CdB+Qusq5sOy3hcDO5CytQNNBcB6OpoIwp9hh87U2jRIdQAu fZL+MN/RHaJwY0SfwFlnlnNDlZcN52Q41Ldn9QyoO5G7J3a8pWK+uYrCuj0Y8eH1UXav 7R5w== 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 k1-20020a50ce41000000b00418edba5779si706984edj.544.2022.03.16.23.15.48; Wed, 16 Mar 2022 23:16:12 -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 S229602AbiCQGFd (ORCPT + 99 others); Thu, 17 Mar 2022 02:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229581AbiCQGFa (ORCPT ); Thu, 17 Mar 2022 02:05:30 -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 1127FA27CE; Wed, 16 Mar 2022 22:36:23 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0V7Q-ubC_1647495378; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V7Q-ubC_1647495378) by smtp.aliyun-inc.com(127.0.0.1); Thu, 17 Mar 2022 13:36:20 +0800 Date: Thu, 17 Mar 2022 13:36:17 +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, gregkh@linuxfoundation.org, tao.peng@linux.alibaba.com, willy@infradead.org, linux-kernel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, linux-fsdevel@vger.kernel.org, luodaowen.backend@bytedance.com, eguan@linux.alibaba.com, gerry@linux.alibaba.com, torvalds@linux-foundation.org Subject: Re: [Linux-cachefs] [PATCH v5 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, gregkh@linuxfoundation.org, tao.peng@linux.alibaba.com, willy@infradead.org, linux-kernel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, linux-fsdevel@vger.kernel.org, luodaowen.backend@bytedance.com, eguan@linux.alibaba.com, gerry@linux.alibaba.com, torvalds@linux-foundation.org References: <20220316131723.111553-1-jefflexu@linux.alibaba.com> <20220316131723.111553-11-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220316131723.111553-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 Wed, Mar 16, 2022 at 09:17: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..f66af9ebda43 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_bdev_mode(struct super_block *sb) How about renaming it as erofs_is_nodev_mode()? Thanks, Gao Xiang > +{ > + return sb->s_bdev; > +} > + > enum { > EROFS_ZIP_CACHE_DISABLED, > EROFS_ZIP_CACHE_READAHEAD, > -- > 2.27.0 > > -- > Linux-cachefs mailing list > Linux-cachefs@redhat.com > https://listman.redhat.com/mailman/listinfo/linux-cachefs