提交 a00dd6c0 编写于 作者: J Jeff Layton 提交者: Trond Myklebust

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: NJeff Layton <jlayton@redhat.com>
Reviewed-by: NWu Fengguang <fengguang.wu@intel.com>
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 5c78f58e
...@@ -1431,15 +1431,17 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr ...@@ -1431,15 +1431,17 @@ static int nfs_commit_unstable_pages(struct inode *inode, struct writeback_contr
int flags = FLUSH_SYNC; int flags = FLUSH_SYNC;
int ret = 0; int ret = 0;
/* Don't commit yet if this is a non-blocking flush and there are if (wbc->sync_mode == WB_SYNC_NONE) {
* lots of outstanding writes for this mapping. /* Don't commit yet if this is a non-blocking flush and there
*/ * are a lot of outstanding writes for this mapping.
if (wbc->sync_mode == WB_SYNC_NONE && */
nfsi->ncommit <= (nfsi->npages >> 1)) if (nfsi->ncommit <= (nfsi->npages >> 1))
goto out_mark_dirty; goto out_mark_dirty;
if (wbc->nonblocking || wbc->for_background) /* don't wait for the COMMIT response */
flags = 0; flags = 0;
}
ret = nfs_commit_inode(inode, flags); ret = nfs_commit_inode(inode, flags);
if (ret >= 0) { if (ret >= 0) {
if (wbc->sync_mode == WB_SYNC_NONE) { if (wbc->sync_mode == WB_SYNC_NONE) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册