Skip to content

Commit

Permalink
Merge pull request dorimanx#70 from LynxChaus/master
Browse files Browse the repository at this point in the history
Fix build for v4.2
  • Loading branch information
dorimanx committed Aug 10, 2015
2 parents 0c3b682 + 5b22491 commit d5f0555
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions exfat_super.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -1591,16 +1598,24 @@ 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;
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34)
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)
Expand Down

0 comments on commit d5f0555

Please sign in to comment.