summaryrefslogtreecommitdiff
path: root/fs/exfat/exfat_super.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-11 04:34:46 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-11 04:34:46 -0300
commit863981e96738983919de841ec669e157e6bdaeb0 (patch)
treed6d89a12e7eb8017837c057935a2271290907f76 /fs/exfat/exfat_super.c
parent8dec7c70575785729a6a9e6719a955e9c545bcab (diff)
Linux-libre 4.7.1-gnupck-4.7.1-gnu
Diffstat (limited to 'fs/exfat/exfat_super.c')
-rw-r--r--fs/exfat/exfat_super.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/exfat/exfat_super.c b/fs/exfat/exfat_super.c
index 02d4fd2c7..d770deaf1 100644
--- a/fs/exfat/exfat_super.c
+++ b/fs/exfat/exfat_super.c
@@ -1670,9 +1670,11 @@ static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb,
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
-#else /* >= 4.1.x */
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
static ssize_t exfat_direct_IO(struct kiocb *iocb,
struct iov_iter *iter, loff_t offset)
+#else /* >= 4.7.x */
+static ssize_t exfat_direct_IO(struct kiocb *iocb, struct iov_iter *iter)
#endif
{
struct inode *inode = iocb->ki_filp->f_mapping->host;
@@ -1694,12 +1696,16 @@ static ssize_t exfat_direct_IO(struct kiocb *iocb,
#else
if (EXFAT_I(inode)->mmu_private < (offset + iov_length(iov, nr_segs)))
#endif
-#else
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,7,0)
if (EXFAT_I(inode)->mmu_private < (offset + iov_iter_count(iter)))
+#else
+ if (EXFAT_I(inode)->mmu_private < iov_iter_count(iter))
#endif
return 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ ret = blockdev_direct_IO(iocb, inode, iter, exfat_get_block);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
ret = blockdev_direct_IO(iocb, inode, iter,
offset, exfat_get_block);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
@@ -1718,7 +1724,10 @@ static ssize_t exfat_direct_IO(struct kiocb *iocb,
offset, nr_segs, exfat_get_block, NULL);
#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,7,0)
+ if ((ret < 0) && (rw & WRITE))
+ exfat_write_failed(mapping, iov_iter_count(iter));
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0)
if ((ret < 0) && (rw & WRITE))
exfat_write_failed(mapping, offset+iov_iter_count(iter));
#elif LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34)