Skip to content

Commit a97a218

Browse files
lostjefflehsiangkao
authored andcommitted
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: Jingbo Xu <jefflexu@linux.alibaba.com> Reviewed-by: Yue Hu <huyue2@coolpad.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Acked-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230407141710.113882-4-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
1 parent eb2c5e4 commit a97a218

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

fs/erofs/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ struct erofs_sb_info {
134134
struct inode *managed_cache;
135135

136136
struct erofs_sb_lz4_info lz4;
137-
struct inode *packed_inode;
138137
#endif /* CONFIG_EROFS_FS_ZIP */
138+
struct inode *packed_inode;
139139
struct erofs_dev_context *devs;
140140
struct dax_device *dax_dev;
141141
u64 dax_part_off;

fs/erofs/super.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
808808

809809
erofs_shrinker_register(sb);
810810
/* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */
811-
#ifdef CONFIG_EROFS_FS_ZIP
812811
if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) {
813812
sbi->packed_inode = erofs_iget(sb, sbi->packed_nid);
814813
if (IS_ERR(sbi->packed_inode)) {
@@ -817,7 +816,6 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
817816
return err;
818817
}
819818
}
820-
#endif
821819
err = erofs_init_managed_cache(sb);
822820
if (err)
823821
return err;
@@ -984,9 +982,9 @@ static void erofs_put_super(struct super_block *sb)
984982
#ifdef CONFIG_EROFS_FS_ZIP
985983
iput(sbi->managed_cache);
986984
sbi->managed_cache = NULL;
985+
#endif
987986
iput(sbi->packed_inode);
988987
sbi->packed_inode = NULL;
989-
#endif
990988
erofs_free_dev_context(sbi->devs);
991989
sbi->devs = NULL;
992990
erofs_fscache_unregister_fs(sb);

0 commit comments

Comments
 (0)