Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9969441f authored by Dave Chinner's avatar Dave Chinner Committed by Dave Chinner
Browse files

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: default avatarDave Chinner <dchinner@redhat.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent 4f69f578
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -851,7 +851,11 @@ xfs_setattr_size(
	 * to hope that the caller sees ENOMEM and retries the truncate
	 * 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)
		return error;
	truncate_setsize(inode, newsize);