| --- |
| drivers/staging/exfat/exfat_super.c | 40 ++++++++++++++++-------------------- |
| 1 file changed, 18 insertions(+), 22 deletions(-) |
| |
| --- a/drivers/staging/exfat/exfat_super.c |
| +++ b/drivers/staging/exfat/exfat_super.c |
| @@ -382,7 +382,7 @@ static long exfat_generic_ioctl(struct f |
| { |
| #if EXFAT_CONFIG_KERNEL_DEBUG |
| #if !(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)) |
| - struct inode *inode = filp->f_dentry->d_inode; |
| + struct inode *inode = file_inode(filp); |
| #endif |
| unsigned int flags; |
| #endif |
| @@ -838,7 +838,8 @@ out: |
| } |
| |
| static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry, |
| - struct inode *new_dir, struct dentry *new_dentry) |
| + struct inode *new_dir, struct dentry *new_dentry, |
| + unsigned int flags) |
| { |
| struct inode *old_inode, *new_inode; |
| struct super_block *sb = old_dir->i_sb; |
| @@ -846,6 +847,9 @@ static int exfat_rename(struct inode *ol |
| loff_t i_pos; |
| int err; |
| |
| + if (flags & ~RENAME_NOREPLACE) |
| + return -EINVAL; |
| + |
| __lock_super(sb); |
| |
| PRINTK("exfat_rename entered\n"); |
| @@ -1011,7 +1015,7 @@ static int exfat_setattr(struct dentry * |
| attr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET); |
| } |
| |
| - error = inode_change_ok(inode, attr); |
| + error = setattr_prepare(dentry, attr); |
| attr->ia_valid = ia_valid; |
| if (error) { |
| return error; |
| @@ -1334,32 +1338,24 @@ static int exfat_write_end(struct file * |
| return err; |
| } |
| |
| -static ssize_t exfat_direct_IO(int rw, struct kiocb *iocb, |
| - const struct iovec *iov, |
| - loff_t offset, unsigned long nr_segs) |
| +static ssize_t exfat_direct_IO(struct kiocb *iocb, struct iov_iter *iter) |
| { |
| - 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 |
| + struct file *file = iocb->ki_filep; |
| + struct address_space *mapping = file->f_mapping; |
| + struct inode *inode = mapping->host; |
| + size_t count = iov_iter_count(iter); |
| + loff_t offset = iocb->ki_pos; |
| ssize_t ret; |
| |
| - if (rw == WRITE) { |
| - if (EXFAT_I(inode)->mmu_private < (offset + iov_length(iov, nr_segs))) |
| + if (iov_iter_rw(iter) == WRITE) { |
| + loff_t size = offset + count |
| + if (EXFAT_I(inode)->mmu_private < size) |
| return 0; |
| } |
| -#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,00) |
| - ret = blockdev_direct_IO(rw, iocb, inode, iov, |
| - offset, nr_segs, exfat_get_block); |
| -#else |
| - ret = blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, |
| - offset, nr_segs, exfat_get_block, NULL); |
| -#endif |
| + ret = blockdev_direct_IO(iocb, inode, iter, exfat_get_block); |
| |
| -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,34) |
| - if ((ret < 0) && (rw & WRITE)) |
| + if ((ret < 0) && (iov_iter_rw(iter) == WRITE)) |
| exfat_write_failed(mapping, offset+iov_length(iov, nr_segs)); |
| -#endif |
| return ret; |
| |
| } |