mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
erofs: get rid of z_erofs_fill_inode()
Prior to big pclusters, non-compact compression indexes could have empty headers. Let's just avoid the legacy path since it can be handled properly as a specific compression header with z_erofs_fill_inode_lazy() too. Tested with erofs-utils exist versions. Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Reviewed-by: Yue Hu <huyue2@coolpad.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230413092241.73829-1-hsiangkao@linux.alibaba.com
This commit is contained in:
parent
6a318ccd7e
commit
4fdadd5b0f
@ -291,11 +291,15 @@ static int erofs_fill_inode(struct inode *inode)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (erofs_inode_is_data_compressed(vi->datalayout)) {
|
if (erofs_inode_is_data_compressed(vi->datalayout)) {
|
||||||
|
#ifdef CONFIG_EROFS_FS_ZIP
|
||||||
if (!erofs_is_fscache_mode(inode->i_sb) &&
|
if (!erofs_is_fscache_mode(inode->i_sb) &&
|
||||||
inode->i_sb->s_blocksize_bits == PAGE_SHIFT)
|
inode->i_sb->s_blocksize_bits == PAGE_SHIFT) {
|
||||||
err = z_erofs_fill_inode(inode);
|
inode->i_mapping->a_ops = &z_erofs_aops;
|
||||||
else
|
err = 0;
|
||||||
err = -EOPNOTSUPP;
|
goto out_unlock;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
err = -EOPNOTSUPP;
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
}
|
}
|
||||||
inode->i_mapping->a_ops = &erofs_raw_access_aops;
|
inode->i_mapping->a_ops = &erofs_raw_access_aops;
|
||||||
|
@ -522,7 +522,6 @@ int erofs_try_to_free_cached_page(struct page *page);
|
|||||||
int z_erofs_load_lz4_config(struct super_block *sb,
|
int z_erofs_load_lz4_config(struct super_block *sb,
|
||||||
struct erofs_super_block *dsb,
|
struct erofs_super_block *dsb,
|
||||||
struct z_erofs_lz4_cfgs *lz4, int len);
|
struct z_erofs_lz4_cfgs *lz4, int len);
|
||||||
int z_erofs_fill_inode(struct inode *inode);
|
|
||||||
int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
|
int z_erofs_map_blocks_iter(struct inode *inode, struct erofs_map_blocks *map,
|
||||||
int flags);
|
int flags);
|
||||||
#else
|
#else
|
||||||
@ -542,7 +541,6 @@ static inline int z_erofs_load_lz4_config(struct super_block *sb,
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
|
|
||||||
#endif /* !CONFIG_EROFS_FS_ZIP */
|
#endif /* !CONFIG_EROFS_FS_ZIP */
|
||||||
|
|
||||||
#ifdef CONFIG_EROFS_FS_ZIP_LZMA
|
#ifdef CONFIG_EROFS_FS_ZIP_LZMA
|
||||||
|
@ -7,24 +7,6 @@
|
|||||||
#include <asm/unaligned.h>
|
#include <asm/unaligned.h>
|
||||||
#include <trace/events/erofs.h>
|
#include <trace/events/erofs.h>
|
||||||
|
|
||||||
int z_erofs_fill_inode(struct inode *inode)
|
|
||||||
{
|
|
||||||
struct erofs_inode *const vi = EROFS_I(inode);
|
|
||||||
struct erofs_sb_info *sbi = EROFS_SB(inode->i_sb);
|
|
||||||
|
|
||||||
if (!erofs_sb_has_big_pcluster(sbi) &&
|
|
||||||
!erofs_sb_has_ztailpacking(sbi) && !erofs_sb_has_fragments(sbi) &&
|
|
||||||
vi->datalayout == EROFS_INODE_COMPRESSED_FULL) {
|
|
||||||
vi->z_advise = 0;
|
|
||||||
vi->z_algorithmtype[0] = 0;
|
|
||||||
vi->z_algorithmtype[1] = 0;
|
|
||||||
vi->z_logical_clusterbits = inode->i_sb->s_blocksize_bits;
|
|
||||||
set_bit(EROFS_I_Z_INITED_BIT, &vi->flags);
|
|
||||||
}
|
|
||||||
inode->i_mapping->a_ops = &z_erofs_aops;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct z_erofs_maprecorder {
|
struct z_erofs_maprecorder {
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct erofs_map_blocks *map;
|
struct erofs_map_blocks *map;
|
||||||
|
Loading…
Reference in New Issue
Block a user