1 ext4: use iomap for zeroing blocks in DAX mode
3 From: Jan Kara <jack@suse.cz>
5 Use iomap infrastructure for zeroing blocks when in DAX mode.
6 ext4_iomap_begin() handles read requests just fine and that's all that
7 is needed for iomap_zero_range().
9 Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
10 Signed-off-by: Jan Kara <jack@suse.cz>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
13 fs/ext4/inode.c | 6 ++++--
14 1 file changed, 4 insertions(+), 2 deletions(-)
16 diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
17 index 83e8411370d3..df017ce3e52d 100644
20 @@ -3849,8 +3849,10 @@ static int ext4_block_zero_page_range(handle_t *handle,
21 if (length > max || length < 0)
25 - return dax_zero_page_range(inode, from, length, ext4_get_block);
26 + if (IS_DAX(inode)) {
27 + return iomap_zero_range(inode, from, length, NULL,
30 return __ext4_block_zero_page_range(handle, mapping, from, length);