]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/fat/inode.c
direct_IO: use iov_iter_rw() instead of rw everywhere
[mirror_ubuntu-zesty-kernel.git] / fs / fat / inode.c
index 497c7c5263c7ca3962c385605fbbb558d351f759..342d791b28dbc75368d06baecdac803b5eb5a63e 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/mpage.h>
 #include <linux/buffer_head.h>
 #include <linux/mount.h>
-#include <linux/aio.h>
 #include <linux/vfs.h>
 #include <linux/parser.h>
 #include <linux/uio.h>
@@ -256,7 +255,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
        size_t count = iov_iter_count(iter);
        ssize_t ret;
 
-       if (rw == WRITE) {
+       if (iov_iter_rw(iter) == WRITE) {
                /*
                 * FIXME: blockdev_direct_IO() doesn't use ->write_begin(),
                 * so we need to update the ->mmu_private to block boundary.
@@ -275,8 +274,8 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb,
         * FAT need to use the DIO_LOCKING for avoiding the race
         * condition of fat_get_block() and ->truncate().
         */
-       ret = blockdev_direct_IO(rw, iocb, inode, iter, offset, fat_get_block);
-       if (ret < 0 && (rw & WRITE))
+       ret = blockdev_direct_IO(iocb, inode, iter, offset, fat_get_block);
+       if (ret < 0 && iov_iter_rw(iter) == WRITE)
                fat_write_failed(mapping, offset + count);
 
        return ret;