Skip to content

Commit

Permalink
Merge pull request dorimanx#85 from FireBurn/master
Browse files Browse the repository at this point in the history
Add support for Linux 4.7
  • Loading branch information
dorimanx committed May 19, 2016
2 parents a8d79fc + 4134316 commit 051167c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 051167c

Please sign in to comment.