hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IB5UKT
--------------------------------
To avoid the 5.10 upgrade causing existing caches to be re-downloaded due to a different directory structure, first remove the "@24/I05erofs" directory by removing erofs_fscache_netfs.
before: .../cache/@24/I05erofs/@16/I0gerofs,erofs1.img/@c5/D0aerofs1.img after: .../cache/@16/I0gerofs,erofs1.img/@c5/D0aerofs1.img mainline: .../cache/Ierofs,erofs1.img/@ba/Derofs1.img
Signed-off-by: Baokun Li libaokun1@huawei.com Signed-off-by: Yu Kuai yukuai3@huawei.com --- fs/erofs/fscache.c | 18 ++---------------- fs/erofs/internal.h | 7 ------- fs/erofs/super.c | 7 ------- 3 files changed, 2 insertions(+), 30 deletions(-)
diff --git a/fs/erofs/fscache.c b/fs/erofs/fscache.c index e6fa21ce686f..f0b9815f56f6 100644 --- a/fs/erofs/fscache.c +++ b/fs/erofs/fscache.c @@ -4,6 +4,7 @@ */ #include <linux/pseudo_fs.h> #include <linux/fscache.h> +#include <linux/fscache-cache.h> #include <linux/mount.h> #include "internal.h"
@@ -25,21 +26,6 @@ static struct file_system_type erofs_anon_fs_type = { .kill_sb = kill_anon_super, };
-struct fscache_netfs erofs_fscache_netfs = { - .name = "erofs", - .version = 0, -}; - -int erofs_fscache_register(void) -{ - return fscache_register_netfs(&erofs_fscache_netfs); -} - -void erofs_fscache_unregister(void) -{ - fscache_unregister_netfs(&erofs_fscache_netfs); -} - const struct fscache_cookie_def erofs_fscache_super_index_def = { .name = "EROFS.super", .type = FSCACHE_COOKIE_TYPE_INDEX, @@ -319,7 +305,7 @@ static int erofs_fscache_register_volume(struct super_block *sb) if (!name) return -ENOMEM;
- volume = fscache_acquire_cookie(erofs_fscache_netfs.primary_index, + volume = fscache_acquire_cookie(&fscache_fsdef_index, &erofs_fscache_super_index_def, name, strlen(name), NULL, 0, NULL, 0, true); if (IS_ERR_OR_NULL(volume)) { diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h index f53d7042a4a7..f961256bd469 100644 --- a/fs/erofs/internal.h +++ b/fs/erofs/internal.h @@ -501,8 +501,6 @@ static inline void z_erofs_exit_zip_subsystem(void) {}
/* fscache.c */ #ifdef CONFIG_EROFS_FS_ONDEMAND -int erofs_fscache_register(void); -void erofs_fscache_unregister(void); int erofs_fscache_register_fs(struct super_block *sb); void erofs_fscache_unregister_fs(struct super_block *sb);
@@ -512,11 +510,6 @@ struct erofs_fscache *erofs_fscache_register_cookie(struct super_block *sb, void erofs_fscache_unregister_cookie(struct erofs_fscache *fscache); extern const struct address_space_operations erofs_fscache_access_aops; #else -static inline int erofs_fscache_register(void) -{ - return 0; -} -static inline void erofs_fscache_unregister(void) {} static inline int erofs_fscache_register_fs(struct super_block *sb) { return -EOPNOTSUPP; diff --git a/fs/erofs/super.c b/fs/erofs/super.c index 769b32cd2cae..eb9f7b71ec14 100644 --- a/fs/erofs/super.c +++ b/fs/erofs/super.c @@ -753,10 +753,6 @@ static int __init erofs_module_init(void) if (err) goto zip_err;
- err = erofs_fscache_register(); - if (err) - goto fscache_err; - err = register_filesystem(&erofs_fs_type); if (err) goto fs_err; @@ -764,8 +760,6 @@ static int __init erofs_module_init(void) return 0;
fs_err: - erofs_fscache_unregister(); -fscache_err: z_erofs_exit_zip_subsystem(); zip_err: erofs_exit_shrinker(); @@ -778,7 +772,6 @@ static int __init erofs_module_init(void) static void __exit erofs_module_exit(void) { unregister_filesystem(&erofs_fs_type); - erofs_fscache_unregister(); z_erofs_exit_zip_subsystem(); erofs_exit_shrinker();