Commit a97a218b authored by Jingbo Xu's avatar Jingbo Xu Committed by Gao Xiang

erofs: move packed inode out of the compression part

packed inode could be used in more scenarios which are independent of
compression in the future.

For example, packed inode could be used to keep extra long xattr
prefixes with the help of following patches.
Signed-off-by: default avatarJingbo Xu <jefflexu@linux.alibaba.com>
Reviewed-by: default avatarYue Hu <huyue2@coolpad.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Acked-by: default avatarChao Yu <chao@kernel.org>
Link: https://lore.kernel.org/r/20230407141710.113882-4-jefflexu@linux.alibaba.comSigned-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent eb2c5e41
...@@ -134,8 +134,8 @@ struct erofs_sb_info { ...@@ -134,8 +134,8 @@ struct erofs_sb_info {
struct inode *managed_cache; struct inode *managed_cache;
struct erofs_sb_lz4_info lz4; struct erofs_sb_lz4_info lz4;
struct inode *packed_inode;
#endif /* CONFIG_EROFS_FS_ZIP */ #endif /* CONFIG_EROFS_FS_ZIP */
struct inode *packed_inode;
struct erofs_dev_context *devs; struct erofs_dev_context *devs;
struct dax_device *dax_dev; struct dax_device *dax_dev;
u64 dax_part_off; u64 dax_part_off;
......
...@@ -808,7 +808,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -808,7 +808,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
erofs_shrinker_register(sb); erofs_shrinker_register(sb);
/* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ /* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */
#ifdef CONFIG_EROFS_FS_ZIP
if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) { if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) {
sbi->packed_inode = erofs_iget(sb, sbi->packed_nid); sbi->packed_inode = erofs_iget(sb, sbi->packed_nid);
if (IS_ERR(sbi->packed_inode)) { if (IS_ERR(sbi->packed_inode)) {
...@@ -817,7 +816,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc) ...@@ -817,7 +816,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
return err; return err;
} }
} }
#endif
err = erofs_init_managed_cache(sb); err = erofs_init_managed_cache(sb);
if (err) if (err)
return err; return err;
...@@ -984,9 +982,9 @@ static void erofs_put_super(struct super_block *sb) ...@@ -984,9 +982,9 @@ static void erofs_put_super(struct super_block *sb)
#ifdef CONFIG_EROFS_FS_ZIP #ifdef CONFIG_EROFS_FS_ZIP
iput(sbi->managed_cache); iput(sbi->managed_cache);
sbi->managed_cache = NULL; sbi->managed_cache = NULL;
#endif
iput(sbi->packed_inode); iput(sbi->packed_inode);
sbi->packed_inode = NULL; sbi->packed_inode = NULL;
#endif
erofs_free_dev_context(sbi->devs); erofs_free_dev_context(sbi->devs);
sbi->devs = NULL; sbi->devs = NULL;
erofs_fscache_unregister_fs(sb); erofs_fscache_unregister_fs(sb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment