[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220316131723.111553-11-jefflexu@linux.alibaba.com>
Date: Wed, 16 Mar 2022 21:17:11 +0800
From: Jeffle Xu <jefflexu@...ux.alibaba.com>
To: dhowells@...hat.com, linux-cachefs@...hat.com, xiang@...nel.org,
chao@...nel.org, linux-erofs@...ts.ozlabs.org
Cc: torvalds@...ux-foundation.org, gregkh@...uxfoundation.org,
willy@...radead.org, linux-fsdevel@...r.kernel.org,
joseph.qi@...ux.alibaba.com, bo.liu@...ux.alibaba.com,
tao.peng@...ux.alibaba.com, gerry@...ux.alibaba.com,
eguan@...ux.alibaba.com, linux-kernel@...r.kernel.org,
luodaowen.backend@...edance.com
Subject: [PATCH v5 10/22] erofs: add mode checking helper
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 <jefflexu@...ux.alibaba.com>
---
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)
+{
+ return sb->s_bdev;
+}
+
enum {
EROFS_ZIP_CACHE_DISABLED,
EROFS_ZIP_CACHE_READAHEAD,
--
2.27.0
Powered by blists - more mailing lists