提交 87ed5eb4 编写于 作者: T Trond Myklebust

NFS: Don't use DATA_SYNC writes

If we're writing back data, and the FLUSH_STABLE flag is set, then we
always want to use NFS_FILE_SYNC, since we're always in a situation where
we're doing page reclaim, and so we want to free up the page as quickly
as possible.

If we're in the FLUSH_COND_STABLE case, then we either want to use another
unstable write (if we have to do a commit anyway) or again, we want to
use NFS_FILE_SYNC because we know that we have no more pages to write
out.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 c47abcf8
...@@ -872,10 +872,14 @@ static int nfs_write_rpcsetup(struct nfs_page *req, ...@@ -872,10 +872,14 @@ static int nfs_write_rpcsetup(struct nfs_page *req,
data->args.context = get_nfs_open_context(req->wb_context); data->args.context = get_nfs_open_context(req->wb_context);
data->args.lock_context = req->wb_lock_context; data->args.lock_context = req->wb_lock_context;
data->args.stable = NFS_UNSTABLE; data->args.stable = NFS_UNSTABLE;
if (how & (FLUSH_STABLE | FLUSH_COND_STABLE)) { switch (how & (FLUSH_STABLE | FLUSH_COND_STABLE)) {
data->args.stable = NFS_DATA_SYNC; case 0:
if (!nfs_need_commit(NFS_I(inode))) break;
data->args.stable = NFS_FILE_SYNC; case FLUSH_COND_STABLE:
if (nfs_need_commit(NFS_I(inode)))
break;
default:
data->args.stable = NFS_FILE_SYNC;
} }
data->res.fattr = &data->fattr; data->res.fattr = &data->fattr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册