summaryrefslogtreecommitdiffstats
path: root/fs/nfs/file.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-05 06:35:40 +0100
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-06 16:46:38 +0100
commit200baa2112012dd8a13db9da3ee6885403f9c013 (patch)
tree261f9c2b85927c2dfaaecfb7ab808d353bd84da4 /fs/nfs/file.c
parentNFS: More cleanups of fs/nfs/write.c (diff)
downloadlinux-200baa2112012dd8a13db9da3ee6885403f9c013.tar.xz
linux-200baa2112012dd8a13db9da3ee6885403f9c013.zip
NFS: Remove nfs_writepage_sync()
Maintaining two parallel ways of doing synchronous writes is rather pointless. This patch gets rid of the legacy nfs_writepage_sync(), and replaces it with the faster asynchronous writes. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/file.c')
-rw-r--r--fs/nfs/file.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index d6ee60fc3ba6..143a19037ce8 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -378,6 +378,12 @@ static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
nfs_add_stats(inode, NFSIOS_NORMALWRITTENBYTES, count);
result = generic_file_aio_write(iocb, iov, nr_segs, pos);
+ /* Return error values for O_SYNC and IS_SYNC() */
+ if (result >= 0 && (IS_SYNC(inode) || (iocb->ki_filp->f_flags & O_SYNC))) {
+ int err = nfs_fsync(iocb->ki_filp, dentry, 1);
+ if (err < 0)
+ result = err;
+ }
out:
return result;