summaryrefslogtreecommitdiffstats
path: root/fs/ntfs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-07 11:52:01 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-01 19:58:39 -0400
commite259221763a40403d5bb232209998e8c45804ab8 (patch)
tree6f940ba17f38b693e495ad5267b1988dd66c9c0f /fs/ntfs
parentdde0c2e79848298cc25621ad080d47f94dbd7cce (diff)
fs: simplify the generic_write_sync prototype
The kiocb already has the new position, so use that. The only interesting case is AIO, where we currently don't bother updating ki_pos. We're about to free the kiocb after we're done, so we might as well update it to make everyone's life simpler. While we're at it also return the bytes written argument passed in if we were successful so that the boilerplate error switch code in the callers can go away. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ntfs')
-rw-r--r--fs/ntfs/file.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/fs/ntfs/file.c b/fs/ntfs/file.c
index 10dc38cc02bb..5622ed5a201e 100644
--- a/fs/ntfs/file.c
+++ b/fs/ntfs/file.c
@@ -1952,12 +1952,9 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
1952 written = ntfs_perform_write(file, from, iocb->ki_pos); 1952 written = ntfs_perform_write(file, from, iocb->ki_pos);
1953 current->backing_dev_info = NULL; 1953 current->backing_dev_info = NULL;
1954 inode_unlock(vi); 1954 inode_unlock(vi);
1955 if (likely(written > 0)) {
1956 err = generic_write_sync(iocb, iocb->ki_pos, written);
1957 if (err < 0)
1958 written = 0;
1959 }
1960 iocb->ki_pos += written; 1955 iocb->ki_pos += written;
1956 if (likely(written > 0))
1957 written = generic_write_sync(iocb, written);
1961 return written ? written : err; 1958 return written ? written : err;
1962} 1959}
1963 1960