summaryrefslogtreecommitdiffstats
path: root/fs/nfs/inode.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-12-13 15:23:47 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 15:35:07 -0800
commitd30c8348a4ba292a09addd122de2f3189c21a7ff (patch)
tree4aa5bf398902741643c8e6e88d5676ca02b5dfa2 /fs/nfs/inode.c
parentf40313ac39fedca519c36fdc454acf2632e641da (diff)
downloadblackbird-op-linux-d30c8348a4ba292a09addd122de2f3189c21a7ff.tar.gz
blackbird-op-linux-d30c8348a4ba292a09addd122de2f3189c21a7ff.zip
NFS: nfs_writepages() cleanup
Strip out the call to nfs_commit_inode(), and allow that to be done by nfs_write_inode(). Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/inode.c')
-rw-r--r--fs/nfs/inode.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index d83498282837..4ef454763886 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -65,13 +65,18 @@ nfs_fattr_to_ino_t(struct nfs_fattr *fattr)
int nfs_write_inode(struct inode *inode, int sync)
{
- int flags = sync ? FLUSH_SYNC : 0;
int ret;
- ret = nfs_commit_inode(inode, flags);
- if (ret < 0)
- return ret;
- return 0;
+ if (sync) {
+ ret = filemap_fdatawait(inode->i_mapping);
+ if (ret == 0)
+ ret = nfs_commit_inode(inode, FLUSH_SYNC);
+ } else
+ ret = nfs_commit_inode(inode, 0);
+ if (ret >= 0)
+ return 0;
+ __mark_inode_dirty(inode, I_DIRTY_DATASYNC);
+ return ret;
}
void nfs_clear_inode(struct inode *inode)
OpenPOWER on IntegriCloud