]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - fs/ext2/inode.c
dax,ext2: replace XIP read and write with DAX I/O
[mirror_ubuntu-artful-kernel.git] / fs / ext2 / inode.c
index 0cb04486577d63791c362831d8fb14fbf02d9b15..3ccd5fd47d661639551c953a1abc777e18c41396 100644 (file)
@@ -859,7 +859,12 @@ ext2_direct_IO(int rw, struct kiocb *iocb, struct iov_iter *iter,
        size_t count = iov_iter_count(iter);
        ssize_t ret;
 
-       ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, ext2_get_block);
+       if (IS_DAX(inode))
+               ret = dax_do_io(rw, iocb, inode, iter, offset, ext2_get_block,
+                               NULL, DIO_LOCKING);
+       else
+               ret = blockdev_direct_IO(rw, iocb, inode, iter, offset,
+                                        ext2_get_block);
        if (ret < 0 && (rw & WRITE))
                ext2_write_failed(mapping, offset + count);
        return ret;
@@ -888,6 +893,7 @@ const struct address_space_operations ext2_aops = {
 const struct address_space_operations ext2_aops_xip = {
        .bmap                   = ext2_bmap,
        .get_xip_mem            = ext2_get_xip_mem,
+       .direct_IO              = ext2_direct_IO,
 };
 
 const struct address_space_operations ext2_nobh_aops = {