Skip to content

Commit 0a64bc2

Browse files
author
Al Viro
committed
xfs_file_buffered_aio_write(): switch to generic_perform_write()
Signed-off-by: Al Viro <[email protected]>
1 parent 3b93f91 commit 0a64bc2

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

fs/xfs/xfs_file.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ xfs_file_buffered_aio_write(
715715
const struct iovec *iovp,
716716
unsigned long nr_segs,
717717
loff_t pos,
718-
size_t ocount)
718+
size_t count)
719719
{
720720
struct file *file = iocb->ki_filp;
721721
struct address_space *mapping = file->f_mapping;
@@ -724,22 +724,23 @@ xfs_file_buffered_aio_write(
724724
ssize_t ret;
725725
int enospc = 0;
726726
int iolock = XFS_IOLOCK_EXCL;
727-
size_t count = ocount;
727+
struct iov_iter from;
728728

729729
xfs_rw_ilock(ip, iolock);
730730

731731
ret = xfs_file_aio_write_checks(file, &pos, &count, &iolock);
732732
if (ret)
733733
goto out;
734734

735+
iov_iter_init(&from, iovp, nr_segs, count, 0);
735736
/* We can write back this queue in page reclaim */
736737
current->backing_dev_info = mapping->backing_dev_info;
737738

738739
write_retry:
739740
trace_xfs_file_buffered_write(ip, count, iocb->ki_pos, 0);
740-
ret = generic_file_buffered_write(iocb, iovp, nr_segs,
741-
pos, count, 0);
742-
741+
ret = generic_perform_write(file, &from, pos);
742+
if (likely(ret >= 0))
743+
iocb->ki_pos = pos + ret;
743744
/*
744745
* If we just got an ENOSPC, try to write back all dirty inodes to
745746
* convert delalloc space to free up some of the excess reserved

0 commit comments

Comments
 (0)