summaryrefslogtreecommitdiffstats
path: root/fs/erofs/inode.c
diff options
context:
space:
mode:
authorJingbo Xu <jefflexu@linux.alibaba.com>2024-03-08 10:41:59 +0100
committerGao Xiang <hsiangkao@linux.alibaba.com>2024-03-10 11:41:32 +0100
commita1bafc3109d713ed83f73d61ba5cb1e6fd80fdbc (patch)
tree571d0ec5d9a882da7e093e983e251955be9fb2f0 /fs/erofs/inode.c
parenterofs: make iov_iter describe target buffers over fscache (diff)
downloadlinux-a1bafc3109d713ed83f73d61ba5cb1e6fd80fdbc.tar.xz
linux-a1bafc3109d713ed83f73d61ba5cb1e6fd80fdbc.zip
erofs: support compressed inodes over fscache
Since fscache can utilize iov_iter to write dest buffers, bio_vec can be used in this way too. To simplify this, pseudo bios are prepared and bio_vec will be filled with bio_add_page(). And a common .bi_end_io will be called directly to handle I/O completions. Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Link: https://lore.kernel.org/r/20240308094159.40547-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/inode.c')
-rw-r--r--fs/erofs/inode.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c
index 36e638e8b53a..0eb0e6f933c3 100644
--- a/fs/erofs/inode.c
+++ b/fs/erofs/inode.c
@@ -259,14 +259,12 @@ static int erofs_fill_inode(struct inode *inode)
if (erofs_inode_is_data_compressed(vi->datalayout)) {
#ifdef CONFIG_EROFS_FS_ZIP
- if (!erofs_is_fscache_mode(inode->i_sb)) {
- DO_ONCE_LITE_IF(inode->i_sb->s_blocksize != PAGE_SIZE,
- erofs_info, inode->i_sb,
- "EXPERIMENTAL EROFS subpage compressed block support in use. Use at your own risk!");
- inode->i_mapping->a_ops = &z_erofs_aops;
- err = 0;
- goto out_unlock;
- }
+ DO_ONCE_LITE_IF(inode->i_blkbits != PAGE_SHIFT,
+ erofs_info, inode->i_sb,
+ "EXPERIMENTAL EROFS subpage compressed block support in use. Use at your own risk!");
+ inode->i_mapping->a_ops = &z_erofs_aops;
+ err = 0;
+ goto out_unlock;
#endif
err = -EOPNOTSUPP;
goto out_unlock;