diff options
author | Jeffle Xu <jefflexu@linux.alibaba.com> | 2022-04-25 20:21:38 +0800 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2022-05-18 00:11:20 +0800 |
commit | 955b478e1b4ad5530cd10395d56d45119d3a3ff4 (patch) | |
tree | 76aa7f79d933f3f62618b32d6f28a4a26886bdf3 /fs/erofs/super.c | |
parent | 37c90c5fae701983e21cc80396649e3aca7f4fa1 (diff) | |
download | linux-stable-955b478e1b4ad5530cd10395d56d45119d3a3ff4.tar.gz linux-stable-955b478e1b4ad5530cd10395d56d45119d3a3ff4.tar.bz2 linux-stable-955b478e1b4ad5530cd10395d56d45119d3a3ff4.zip |
erofs: register fscache context for extra data blobs
Similar to the multi-device mode, erofs could be mounted from one
primary data blob (mandatory) and multiple extra data blobs (optional).
Register fscache context for each extra data blob.
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-17-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.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 84b976636d22..a67c19dc0620 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -260,7 +260,12 @@ static int erofs_init_devices(struct super_block *sb, } dis = ptr + erofs_blkoff(pos); - if (!erofs_is_fscache_mode(sb)) { + if (erofs_is_fscache_mode(sb)) { + err = erofs_fscache_register_cookie(sb, &dif->fscache, + dif->path, false); + if (err) + break; + } else { bdev = blkdev_get_by_path(dif->path, FMODE_READ | FMODE_EXCL, sb->s_type); @@ -750,6 +755,7 @@ static int erofs_release_device_info(int id, void *ptr, void *data) fs_put_dax(dif->dax_dev); if (dif->bdev) blkdev_put(dif->bdev, FMODE_READ | FMODE_EXCL); + erofs_fscache_unregister_cookie(&dif->fscache); kfree(dif->path); kfree(dif); return 0; |