提交 9969441f 编写于 作者: D Dave Chinner 提交者: Dave Chinner

xfs: add DAX truncate support

When we truncate a DAX file, we need to call through the DAX page
truncation path rather than through block_truncate_page() so that
mappings and block zeroing are all handled correctly. Otherwise,
truncate does not need to change.
Signed-off-by: NDave Chinner <dchinner@redhat.com>
Reviewed-by: NBrian Foster <bfoster@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 4f69f578
...@@ -851,7 +851,11 @@ xfs_setattr_size( ...@@ -851,7 +851,11 @@ xfs_setattr_size(
* to hope that the caller sees ENOMEM and retries the truncate * to hope that the caller sees ENOMEM and retries the truncate
* operation. * operation.
*/ */
error = block_truncate_page(inode->i_mapping, newsize, xfs_get_blocks); if (IS_DAX(inode))
error = dax_truncate_page(inode, newsize, xfs_get_blocks_direct);
else
error = block_truncate_page(inode->i_mapping, newsize,
xfs_get_blocks);
if (error) if (error)
return error; return error;
truncate_setsize(inode, newsize); truncate_setsize(inode, newsize);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册