Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186162
b: refs/heads/master
c: 420e364
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Mar 5, 2010
1 parent 9c6d58b commit 781fedf
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff778d02bf867e1733a09b34ad6dbb723b024814
refs/heads/master: 420e3646bb7d93a571734034249fbb1ae1a7a5c7
26 changes: 22 additions & 4 deletions trunk/fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1415,12 +1415,30 @@ static int nfs_commit_inode(struct inode *inode, int how)

static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_control *wbc)
{
int ret;
struct nfs_inode *nfsi = NFS_I(inode);
int flags = FLUSH_SYNC;
int ret = 0;

ret = nfs_commit_inode(inode,
wbc->sync_mode == WB_SYNC_ALL ? FLUSH_SYNC : 0);
if (ret >= 0)
/* Don't commit yet if this is a non-blocking flush and there are
* lots of outstanding writes for this mapping.
*/
if (wbc->sync_mode == WB_SYNC_NONE &&
nfsi->ncommit <= (nfsi->npages >> 1))
goto out_mark_dirty;

if (wbc->nonblocking)
flags = 0;
ret = nfs_commit_inode(inode, flags);
if (ret >= 0) {
if (wbc->sync_mode == WB_SYNC_NONE) {
if (ret < wbc->nr_to_write)
wbc->nr_to_write -= ret;
else
wbc->nr_to_write = 0;
}
return 0;
}
out_mark_dirty:
__mark_inode_dirty(inode, I_DIRTY_DATASYNC);
return ret;
}
Expand Down

0 comments on commit 781fedf

Please sign in to comment.