aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2010-09-28 09:14:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-09-29 14:42:30 -0400
commita00dd6c03dd97a777c291a8af8682be4b5fadf8d (patch)
tree184600accd17f16115becb5f3454f18e88987643 /fs/nfs/write.c
parent5c78f58e2d5cef65c255a556184f1f43c8d84c84 (diff)
NFS: don't use FLUSH_SYNC on WB_SYNC_NONE COMMIT calls (try #2)
WB_SYNC_NONE is supposed to mean "don't wait on anything". That should also include not waiting for COMMIT calls to complete. WB_SYNC_NONE is also implied when wbc->nonblocking and wbc->for_background are set, so we can replace those checks in nfs_commit_unstable_pages with a check for WB_SYNC_NONE. Signed-off-by: Jeff Layton <jlayton@redhat.com> Reviewed-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 4d6d35dd2b4b..605e292501f4 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1431,15 +1431,17 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr
1431 int flags = FLUSH_SYNC; 1431 int flags = FLUSH_SYNC;
1432 int ret = 0; 1432 int ret = 0;
1433 1433
1434 /* Don't commit yet if this is a non-blocking flush and there are 1434 if (wbc->sync_mode == WB_SYNC_NONE) {
1435 * lots of outstanding writes for this mapping. 1435 /* Don't commit yet if this is a non-blocking flush and there
1436 */ 1436 * are a lot of outstanding writes for this mapping.
1437 if (wbc->sync_mode == WB_SYNC_NONE && 1437 */
1438 nfsi->ncommit <= (nfsi->npages >> 1)) 1438 if (nfsi->ncommit <= (nfsi->npages >> 1))
1439 goto out_mark_dirty; 1439 goto out_mark_dirty;
1440 1440
1441 if (wbc->nonblocking || wbc->for_background) 1441 /* don't wait for the COMMIT response */
1442 flags = 0; 1442 flags = 0;
1443 }
1444
1443 ret = nfs_commit_inode(inode, flags); 1445 ret = nfs_commit_inode(inode, flags);
1444 if (ret >= 0) { 1446 if (ret >= 0) {
1445 if (wbc->sync_mode == WB_SYNC_NONE) { 1447 if (wbc->sync_mode == WB_SYNC_NONE) {