mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
erofs: fix fsdax unavailability for chunk-based regular files
[ Upstream commit18bddc5b67
] DAX can be used to share page cache between VMs, reducing guest memory overhead. And chunk based data format is widely used for VM and container image. So enable dax support for it, make erofs better used for VM scenarios. Fixes:c5aa903a59
("erofs: support reading chunk-based uncompressed files") Signed-off-by: Xin Yin <yinxin.x@bytedance.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230711062130.7860-1-yinxin.x@bytedance.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3cf79e59ca
commit
f30de55777
1 changed files with 2 additions and 1 deletions
|
@ -183,7 +183,8 @@ static void *erofs_read_inode(struct erofs_buf *buf,
|
||||||
|
|
||||||
inode->i_flags &= ~S_DAX;
|
inode->i_flags &= ~S_DAX;
|
||||||
if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) &&
|
if (test_opt(&sbi->opt, DAX_ALWAYS) && S_ISREG(inode->i_mode) &&
|
||||||
vi->datalayout == EROFS_INODE_FLAT_PLAIN)
|
(vi->datalayout == EROFS_INODE_FLAT_PLAIN ||
|
||||||
|
vi->datalayout == EROFS_INODE_CHUNK_BASED))
|
||||||
inode->i_flags |= S_DAX;
|
inode->i_flags |= S_DAX;
|
||||||
|
|
||||||
if (!nblks)
|
if (!nblks)
|
||||||
|
|
Loading…
Reference in a new issue