summaryrefslogtreecommitdiffstats
path: root/fs/nfs/direct.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-04-07 17:52:01 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2016-05-02 01:58:39 +0200
commite259221763a40403d5bb232209998e8c45804ab8 (patch)
tree6f940ba17f38b693e495ad5267b1988dd66c9c0f /fs/nfs/direct.c
parentfs: add IOCB_SYNC and IOCB_DSYNC (diff)
downloadlinux-e259221763a40403d5bb232209998e8c45804ab8.tar.xz
linux-e259221763a40403d5bb232209998e8c45804ab8.zip
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/nfs/direct.c')
-rw-r--r--fs/nfs/direct.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index be86de9a77d7..0b9fca040b0c 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -1054,7 +1054,9 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, struct iov_iter *iter)
if (i_size_read(inode) < iocb->ki_pos)
i_size_write(inode, iocb->ki_pos);
spin_unlock(&inode->i_lock);
- generic_write_sync(iocb, pos, result);
+
+ /* XXX: should check the generic_write_sync retval */
+ generic_write_sync(iocb, result);
}
}
nfs_direct_req_release(dreq);