summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_file.c
diff options
context:
space:
mode:
authorAl Viro2015-04-09 18:55:47 +0200
committerAl Viro2015-04-12 04:30:21 +0200
commit3309dd04cbcd2cdad168485af5cf3576b5051e49 (patch)
tree3e01f865306dee01b31f34c9e7e819a5f42a4087 /fs/xfs/xfs_file.c
parentocfs2: move generic_write_checks() before the alignment checks (diff)
downloadkernel-qcow2-linux-3309dd04cbcd2cdad168485af5cf3576b5051e49.tar.gz
kernel-qcow2-linux-3309dd04cbcd2cdad168485af5cf3576b5051e49.tar.xz
kernel-qcow2-linux-3309dd04cbcd2cdad168485af5cf3576b5051e49.zip
switch generic_write_checks() to iocb and iter
... returning -E... upon error and amount of data left in iter after (possible) truncation upon success. Note, that normal case gives a non-zero (positive) return value, so any tests for != 0 _must_ be updated. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Conflicts: fs/ext4/file.c
Diffstat (limited to 'fs/xfs/xfs_file.c')
-rw-r--r--fs/xfs/xfs_file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index ebde43e15dd9..28d157807b42 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -551,12 +551,12 @@ xfs_file_aio_write_checks(
struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
struct xfs_inode *ip = XFS_I(inode);
- int error = 0;
+ ssize_t error = 0;
size_t count = iov_iter_count(from);
restart:
- error = generic_write_checks(file, &iocb->ki_pos, &count);
- if (error)
+ error = generic_write_checks(iocb, from);
+ if (error <= 0)
return error;
error = xfs_break_layouts(inode, iolock);
@@ -577,13 +577,13 @@ restart:
xfs_rw_iunlock(ip, *iolock);
*iolock = XFS_IOLOCK_EXCL;
xfs_rw_ilock(ip, *iolock);
+ iov_iter_reexpand(from, count);
goto restart;
}
error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), &zero);
if (error)
return error;
}
- iov_iter_truncate(from, count);
/*
* Updating the timestamps will grab the ilock again from