summaryrefslogtreecommitdiff
path: root/fs/erofs/super.c
diff options
context:
space:
mode:
authorJeffle Xu <jefflexu@linux.alibaba.com>2022-04-25 20:21:33 +0800
committerGao Xiang <hsiangkao@linux.alibaba.com>2022-05-18 00:11:19 +0800
commitc6be2bd0a5dd91f98d6b5d2df2c79bc32993352c (patch)
treebc705998a4298763cba68de5119fd187409d7dd8 /fs/erofs/super.c
parent93b856bb5f66ae149ed91876b17c8c3fca576615 (diff)
erofs: register fscache volume
A new fscache based mode is going to be introduced for erofs, in which case on-demand read semantics is implemented through fscache. As the first step, register fscache volume for each erofs filesystem. That means, data blobs can not be shared among erofs filesystems. In the following iteration, we are going to introduce the domain semantics, in which case several erofs filesystems can belong to one domain, and data blobs can be shared among these erofs filesystems of one domain. Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20220425122143.56815-12-jefflexu@linux.alibaba.com Acked-by: Chao Yu <chao@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/super.c')
-rw-r--r--fs/erofs/super.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 46ca7917cb2a..402f919eef6b 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -641,6 +641,10 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
if (erofs_is_fscache_mode(sb)) {
sb->s_blocksize = EROFS_BLKSIZ;
sb->s_blocksize_bits = LOG_BLOCK_SIZE;
+
+ err = erofs_fscache_register_fs(sb);
+ if (err)
+ return err;
} else {
if (!sb_set_blocksize(sb, EROFS_BLKSIZ)) {
erofs_err(sb, "failed to set erofs blksize");
@@ -808,6 +812,7 @@ static void erofs_kill_sb(struct super_block *sb)
erofs_free_dev_context(sbi->devs);
fs_put_dax(sbi->dax_dev);
+ erofs_fscache_unregister_fs(sb);
kfree(sbi);
sb->s_fs_info = NULL;
}