add patch fix-checks-for-data-ordered-and-journal_async_commit-options
[ext4-patch-queue.git] / use-iomap-for-zeroing-blocks-in-DAX-mode
blob1b23eaf85d325d7de16e9bc7dd70dd3fdb97ca1c
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>
12 ---
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
18 --- a/fs/ext4/inode.c
19 +++ b/fs/ext4/inode.c
20 @@ -3849,8 +3849,10 @@ static int ext4_block_zero_page_range(handle_t *handle,
21         if (length > max || length < 0)
22                 length = max;
24 -       if (IS_DAX(inode))
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,
28 +                                       &ext4_iomap_ops);
29 +       }
30         return __ext4_block_zero_page_range(handle, mapping, from, length);
31  }
33 -- 
34 2.6.6