diff options
Diffstat (limited to 'fs/xfs')
-rw-r--r-- | fs/xfs/xfs_file.c | 13 | ||||
-rw-r--r-- | fs/xfs/xfs_ioctl.c | 28 |
2 files changed, 8 insertions, 33 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c index 003c0051b62f..79e96ce98733 100644 --- a/fs/xfs/xfs_file.c +++ b/fs/xfs/xfs_file.c | |||
@@ -699,7 +699,7 @@ xfs_file_dio_aio_write( | |||
699 | 699 | ||
700 | trace_xfs_file_direct_write(ip, count, iocb->ki_pos, 0); | 700 | trace_xfs_file_direct_write(ip, count, iocb->ki_pos, 0); |
701 | ret = generic_file_direct_write(iocb, iovp, | 701 | ret = generic_file_direct_write(iocb, iovp, |
702 | &nr_segs, pos, &iocb->ki_pos, count, ocount); | 702 | &nr_segs, pos, count, ocount); |
703 | 703 | ||
704 | out: | 704 | out: |
705 | xfs_rw_iunlock(ip, iolock); | 705 | xfs_rw_iunlock(ip, iolock); |
@@ -715,7 +715,7 @@ xfs_file_buffered_aio_write( | |||
715 | const struct iovec *iovp, | 715 | const struct iovec *iovp, |
716 | unsigned long nr_segs, | 716 | unsigned long nr_segs, |
717 | loff_t pos, | 717 | loff_t pos, |
718 | size_t ocount) | 718 | size_t count) |
719 | { | 719 | { |
720 | struct file *file = iocb->ki_filp; | 720 | struct file *file = iocb->ki_filp; |
721 | struct address_space *mapping = file->f_mapping; | 721 | struct address_space *mapping = file->f_mapping; |
@@ -724,7 +724,7 @@ xfs_file_buffered_aio_write( | |||
724 | ssize_t ret; | 724 | ssize_t ret; |
725 | int enospc = 0; | 725 | int enospc = 0; |
726 | int iolock = XFS_IOLOCK_EXCL; | 726 | int iolock = XFS_IOLOCK_EXCL; |
727 | size_t count = ocount; | 727 | struct iov_iter from; |
728 | 728 | ||
729 | xfs_rw_ilock(ip, iolock); | 729 | xfs_rw_ilock(ip, iolock); |
730 | 730 | ||
@@ -732,14 +732,15 @@ xfs_file_buffered_aio_write( | |||
732 | if (ret) | 732 | if (ret) |
733 | goto out; | 733 | goto out; |
734 | 734 | ||
735 | iov_iter_init(&from, iovp, nr_segs, count, 0); | ||
735 | /* We can write back this queue in page reclaim */ | 736 | /* We can write back this queue in page reclaim */ |
736 | current->backing_dev_info = mapping->backing_dev_info; | 737 | current->backing_dev_info = mapping->backing_dev_info; |
737 | 738 | ||
738 | write_retry: | 739 | write_retry: |
739 | trace_xfs_file_buffered_write(ip, count, iocb->ki_pos, 0); | 740 | trace_xfs_file_buffered_write(ip, count, iocb->ki_pos, 0); |
740 | ret = generic_file_buffered_write(iocb, iovp, nr_segs, | 741 | ret = generic_perform_write(file, &from, pos); |
741 | pos, &iocb->ki_pos, count, 0); | 742 | if (likely(ret >= 0)) |
742 | 743 | iocb->ki_pos = pos + ret; | |
743 | /* | 744 | /* |
744 | * If we just got an ENOSPC, try to write back all dirty inodes to | 745 | * If we just got an ENOSPC, try to write back all dirty inodes to |
745 | * convert delalloc space to free up some of the excess reserved | 746 | * convert delalloc space to free up some of the excess reserved |
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index bcfe61202115..0b18776b075e 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c | |||
@@ -271,32 +271,6 @@ xfs_open_by_handle( | |||
271 | return error; | 271 | return error; |
272 | } | 272 | } |
273 | 273 | ||
274 | /* | ||
275 | * This is a copy from fs/namei.c:vfs_readlink(), except for removing it's | ||
276 | * unused first argument. | ||
277 | */ | ||
278 | STATIC int | ||
279 | do_readlink( | ||
280 | char __user *buffer, | ||
281 | int buflen, | ||
282 | const char *link) | ||
283 | { | ||
284 | int len; | ||
285 | |||
286 | len = PTR_ERR(link); | ||
287 | if (IS_ERR(link)) | ||
288 | goto out; | ||
289 | |||
290 | len = strlen(link); | ||
291 | if (len > (unsigned) buflen) | ||
292 | len = buflen; | ||
293 | if (copy_to_user(buffer, link, len)) | ||
294 | len = -EFAULT; | ||
295 | out: | ||
296 | return len; | ||
297 | } | ||
298 | |||
299 | |||
300 | int | 274 | int |
301 | xfs_readlink_by_handle( | 275 | xfs_readlink_by_handle( |
302 | struct file *parfilp, | 276 | struct file *parfilp, |
@@ -334,7 +308,7 @@ xfs_readlink_by_handle( | |||
334 | error = -xfs_readlink(XFS_I(dentry->d_inode), link); | 308 | error = -xfs_readlink(XFS_I(dentry->d_inode), link); |
335 | if (error) | 309 | if (error) |
336 | goto out_kfree; | 310 | goto out_kfree; |
337 | error = do_readlink(hreq->ohandle, olen, link); | 311 | error = readlink_copy(hreq->ohandle, olen, link); |
338 | if (error) | 312 | if (error) |
339 | goto out_kfree; | 313 | goto out_kfree; |
340 | 314 | ||