diff options
author | Huang Jianan <huangjianan@oppo.com> | 2021-08-05 02:35:59 +0200 |
---|---|---|
committer | Gao Xiang <hsiangkao@linux.alibaba.com> | 2021-08-09 18:14:42 +0200 |
commit | a08e67a0280215f74eccf14fda81dd7fed6596ba (patch) | |
tree | 604222ed7dd17b0c74c35b63f51334d0b7c0a3b8 /fs/erofs/inode.c | |
parent | Linux 5.14-rc4 (diff) | |
download | linux-a08e67a0280215f74eccf14fda81dd7fed6596ba.tar.xz linux-a08e67a0280215f74eccf14fda81dd7fed6596ba.zip |
erofs: iomap support for non-tailpacking DIO
Add iomap support for non-tailpacking uncompressed data in order to
support DIO and DAX.
Direct I/O is useful in certain scenarios for uncompressed files.
For example, double pagecache can be avoid by direct I/O when
loop device is used for uncompressed files containing upper layer
compressed filesystem.
This adds iomap DIO support for non-tailpacking cases first and
tail-packing inline files are handled in the follow-up patch.
Link: https://lore.kernel.org/r/20210805003601.183063-2-hsiangkao@linux.alibaba.com
Cc: linux-fsdevel@vger.kernel.org
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Huang Jianan <huangjianan@oppo.com>
Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/inode.c')
-rw-r--r-- | fs/erofs/inode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/erofs/inode.c b/fs/erofs/inode.c index aa8a0d770ba3..f296e1a2661e 100644 --- a/fs/erofs/inode.c +++ b/fs/erofs/inode.c @@ -247,7 +247,10 @@ static int erofs_fill_inode(struct inode *inode, int isdir) switch (inode->i_mode & S_IFMT) { case S_IFREG: inode->i_op = &erofs_generic_iops; - inode->i_fop = &generic_ro_fops; + if (erofs_inode_is_data_compressed(vi->datalayout)) + inode->i_fop = &generic_ro_fops; + else + inode->i_fop = &erofs_file_fops; break; case S_IFDIR: inode->i_op = &erofs_dir_iops; |