]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ext4: use iomap for zeroing blocks in DAX mode
authorJan Kara <jack@suse.cz>
Sun, 20 Nov 2016 23:08:05 +0000 (18:08 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 20 Nov 2016 23:08:05 +0000 (18:08 -0500)
Use iomap infrastructure for zeroing blocks when in DAX mode.
ext4_iomap_begin() handles read requests just fine and that's all that
is needed for iomap_zero_range().

Reviewed-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c

index 5e0526fed165fd0edc9e0bb5eaa55c1b36df4767..6d186ca2c34be8978c299db1b7074c18eeadb9c5 100644 (file)
@@ -3859,8 +3859,10 @@ static int ext4_block_zero_page_range(handle_t *handle,
        if (length > max || length < 0)
                length = max;
 
-       if (IS_DAX(inode))
-               return dax_zero_page_range(inode, from, length, ext4_get_block);
+       if (IS_DAX(inode)) {
+               return iomap_zero_range(inode, from, length, NULL,
+                                       &ext4_iomap_ops);
+       }
        return __ext4_block_zero_page_range(handle, mapping, from, length);
 }