diff --git a/exfat_super.c b/exfat_super.c index 12a3228..f2c70a3 100644 --- a/exfat_super.c +++ b/exfat_super.c @@ -1307,13 +1307,20 @@ const struct inode_operations exfat_dir_inode_operations = { /*======================================================================*/ /* File Operations */ /*======================================================================*/ - +#if LINUX_VERSION_CODE > KERNEL_VERSION(4,1,0) +static const char *exfat_follow_link(struct dentry *dentry, void **cookie) +{ + struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode); + return *cookie = (char *)(ei->target); +} +#else static void *exfat_follow_link(struct dentry *dentry, struct nameidata *nd) { struct exfat_inode_info *ei = EXFAT_I(dentry->d_inode); nd_set_link(nd, (char *)(ei->target)); return NULL; } +#endif const struct inode_operations exfat_symlink_inode_operations = { .readlink = generic_readlink, @@ -1591,9 +1598,12 @@ static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, loff_t offset, unsigned long nr_segs) #endif -#else +#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 */ +static ssize_t exfat_direct_IO(struct kiocb *iocb, + struct iov_iter *iter, loff_t offset) #endif { struct inode *inode = iocb->ki_filp->f_mapping->host; @@ -1601,6 +1611,11 @@ static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb, struct address_space *mapping = iocb->ki_filp->f_mapping; #endif ssize_t ret; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) + int rw; + + rw = iov_iter_rw(iter); +#endif if (rw == WRITE) { #if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0)