Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2166171pxb; Fri, 25 Mar 2022 12:16:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxFhVoDLMnvc1FJSVTXw5OKozAOThNL60A1Rljn1j65tmTkjGbs4af4xijWmK9e5h/cWpOT X-Received: by 2002:a17:902:ab01:b0:153:2dec:6761 with SMTP id ik1-20020a170902ab0100b001532dec6761mr13350895plb.71.1648235765275; Fri, 25 Mar 2022 12:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648235765; cv=none; d=google.com; s=arc-20160816; b=VgGWRo+eRpEzlqr0qkGVCu/DYpx0gLfL5Jqxbof+OE4jH5nAlNk96oy2XwbXKN7f9v QRZVjhCGvBSP6zcGQ8FmYhIwbkl2YKE/T+Q9lk3cyfdoxz0o5LZEzgjyHlbrrpQceEwb 9Xz7xdbWssL9U5StZTyU2qlDy9KnYX//ih95KzS8WNSPb6wPJzFLKaZO+PbZuG/KH8Z3 3pkfgowVYkNFr7wQ5cuLCt9LljrXPJRPhxNAycH2uXEJAfAiUfLuyM7SiYf95p3FfpjW TJ6vtsnqz/8JY6WsNvsICPQsOg/7284UGxyX2ztp2X1firPPGIvPwGpH65Cj0HyunCan XUvQ== 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=bBnWzucDCchHvOVz2HE/LDPrpMnKcLfaYdok5H8A1l0=; b=x9dH9A+8rUV6zxFYYqSuqxq/9rdO9TkwimSIrCLZTOWYFASlYqe0xbfC+vD9ugpIbG TncgYzSUPNd08Z86OZWBUIOhx5GGypFn+jk6mVcXyJ4iBTwtbfJQ+t335Au7SB+zjP6m QrF1NesjZKRn5XLDhsSAWlOkK5FbLYeiBm/Fa2f2d/qJAzzI+FixjjlvnI1tlOeomW/H Afd7Va1HkVMgru3xevUWAD6m+cObL9xWuaEx3LkKzZVJpxFIe+9IF3jD6yOWR/xs5Lsk 6fBc9NaTsNFmsNycew02W2UqxQmolZV9n6CGJ1nLy7kyVIUfauEdsN1z/VUX+iHUEeOq vBwg== 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:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c20-20020aa78e14000000b004fa916d202fsi3549541pfr.9.2022.03.25.12.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 F40C522AC62; Fri, 25 Mar 2022 11:20:49 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359103AbiCYMZc (ORCPT + 99 others); Fri, 25 Mar 2022 08:25:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1359028AbiCYMYo (ORCPT ); Fri, 25 Mar 2022 08:24:44 -0400 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48B97D5E86; Fri, 25 Mar 2022 05:22:45 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=jefflexu@linux.alibaba.com;NM=1;PH=DS;RN=18;SR=0;TI=SMTPD_---0V89zY2j_1648210959; Received: from localhost(mailfrom:jefflexu@linux.alibaba.com fp:SMTPD_---0V89zY2j_1648210959) by smtp.aliyun-inc.com(127.0.0.1); Fri, 25 Mar 2022 20:22:40 +0800 From: Jeffle Xu To: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org Cc: 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: [PATCH v6 10/22] erofs: add mode checking helper Date: Fri, 25 Mar 2022 20:22:11 +0800 Message-Id: <20220325122223.102958-11-jefflexu@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220325122223.102958-1-jefflexu@linux.alibaba.com> References: <20220325122223.102958-1-jefflexu@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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) +{ + return !sb->s_bdev; +} + enum { EROFS_ZIP_CACHE_DISABLED, EROFS_ZIP_CACHE_READAHEAD, -- 2.27.0