Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp19653pxh; Thu, 7 Apr 2022 12:41:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/ygJamTBebZW4oWSEFLzIqKMJHqvgKMdcUbjNrZwMRLAWpOS0VcmsaniMbFv2BRDOJVOL X-Received: by 2002:a17:90b:1c0d:b0:1c7:3b02:aa68 with SMTP id oc13-20020a17090b1c0d00b001c73b02aa68mr17722525pjb.187.1649360480854; Thu, 07 Apr 2022 12:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649360480; cv=none; d=google.com; s=arc-20160816; b=GI8DtwbKxNlzOUJ4dhXPuczNsCxWtS416D5o6hyuFrWV7vBgxKkUcu3vPANIB4hhC2 A+oLsJoQwdircxaOk0ED+eu80s+P3lQOupWxdQfAtWmrLvLMG46xzB+4bPDD7Iz835M0 WmpN8ybQcd2KQnM72hbuVRAAD4yEK5tYcGl1HGvgvUs2Ywzm5j5AkVJt8NE9m4dzUxPL qvsTAkbTXG+dBxk45wf8nAesO/NTWKcxXlNVK3QRy1SSlDRvJjE/LUfAhsvIsL8fqxKC h35ObgBkvP+TYVFLxa0G8uXkgx/Tmhuq8V8KOwKASKivQ0QoLdxlYT6J8rgsqpbw6XsT 2fIQ== 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=j1O8amXevyy0x92M9Sbv/QFOO1GXoI+RCw+SbxG4+I8=; b=j4sBNTnQtJPgJQjKEoIcJQqOem6sZ8n43/WnTJInRl4uob9GFAD91CRKpsM/uuewdT N5b4nfTpZ8JlDFYRKv9D8tpcVOwDJ6WdVEGmPbN7pidOcOBI20rGxQNObvZ3yiN/3Lf7 3na6MEWiSAi6xNucLqairPajWZRihXPHnzNvh4EZTvuCC+2oM+PoY+FGeHY1kl5O0reo ymr9AC5933QNE7CM8+J/mmoINZhPFSVex8iVOI0t4PRF2MLblmoaKBNdiVtYz9yZES/9 4Rh0S2b5DLQ6TjJBOKV305GUD3XRfikc922JgdW+QXLslIVX8bLMq6JnGJbFNveyh/6q /riQ== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id be1-20020a656e41000000b0039908cc9e0csi15549728pgb.238.2022.04.07.12.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 12:41:20 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4369645782; Thu, 7 Apr 2022 12:16:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239438AbiDGCsK (ORCPT + 99 others); Wed, 6 Apr 2022 22:48:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233189AbiDGCsJ (ORCPT ); Wed, 6 Apr 2022 22:48:09 -0400 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBDFD20DDD4; Wed, 6 Apr 2022 19:46:10 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R261e4;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=19;SR=0;TI=SMTPD_---0V9Oc2IE_1649299564; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0V9Oc2IE_1649299564) by smtp.aliyun-inc.com(127.0.0.1); Thu, 07 Apr 2022 10:46:06 +0800 Date: Thu, 7 Apr 2022 10:46:04 +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 v8 09/20] 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: <20220406075612.60298-1-jefflexu@linux.alibaba.com> <20220406075612.60298-10-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220406075612.60298-10-jefflexu@linux.alibaba.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=no 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, Apr 06, 2022 at 03:56:01PM +0800, Jeffle Xu wrote: > Until then erofs is exactly blockdev based filesystem. > > A new fscache-based mode is going to be introduced for erofs to support > scenarios where on-demand read semantics is needed, e.g. container > image distribution. In this case, erofs could be mounted from data blobs > through fscache. > > Add a helper checking which mode erofs works in. > > Signed-off-by: Jeffle Xu Reviewed-by: Gao Xiang Thanks, Gao Xiang > --- > fs/erofs/internal.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h > index fe9564e5091e..05a97533b1e9 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_fscache_mode(struct super_block *sb) > +{ > + return IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && !sb->s_bdev; > +} > + > enum { > EROFS_ZIP_CACHE_DISABLED, > EROFS_ZIP_CACHE_READAHEAD, > -- > 2.27.0