diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-09 12:55:47 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2015-04-11 22:30:21 -0400 |
commit | 3309dd04cbcd2cdad168485af5cf3576b5051e49 (patch) | |
tree | 3e01f865306dee01b31f34c9e7e819a5f42a4087 /fs/xfs/xfs_file.c | |
parent | 90320251db0fe3d05f2b10686ec936c7d6ecd99a (diff) |
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.c | 8 |
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( | |||
551 | struct file *file = iocb->ki_filp; | 551 | struct file *file = iocb->ki_filp; |
552 | struct inode *inode = file->f_mapping->host; | 552 | struct inode *inode = file->f_mapping->host; |
553 | struct xfs_inode *ip = XFS_I(inode); | 553 | struct xfs_inode *ip = XFS_I(inode); |
554 | int error = 0; | 554 | ssize_t error = 0; |
555 | size_t count = iov_iter_count(from); | 555 | size_t count = iov_iter_count(from); |
556 | 556 | ||
557 | restart: | 557 | restart: |
558 | error = generic_write_checks(file, &iocb->ki_pos, &count); | 558 | error = generic_write_checks(iocb, from); |
559 | if (error) | 559 | if (error <= 0) |
560 | return error; | 560 | return error; |
561 | 561 | ||
562 | error = xfs_break_layouts(inode, iolock); | 562 | error = xfs_break_layouts(inode, iolock); |
@@ -577,13 +577,13 @@ restart: | |||
577 | xfs_rw_iunlock(ip, *iolock); | 577 | xfs_rw_iunlock(ip, *iolock); |
578 | *iolock = XFS_IOLOCK_EXCL; | 578 | *iolock = XFS_IOLOCK_EXCL; |
579 | xfs_rw_ilock(ip, *iolock); | 579 | xfs_rw_ilock(ip, *iolock); |
580 | iov_iter_reexpand(from, count); | ||
580 | goto restart; | 581 | goto restart; |
581 | } | 582 | } |
582 | error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), &zero); | 583 | error = xfs_zero_eof(ip, iocb->ki_pos, i_size_read(inode), &zero); |
583 | if (error) | 584 | if (error) |
584 | return error; | 585 | return error; |
585 | } | 586 | } |
586 | iov_iter_truncate(from, count); | ||
587 | 587 | ||
588 | /* | 588 | /* |
589 | * Updating the timestamps will grab the ilock again from | 589 | * Updating the timestamps will grab the ilock again from |