summaryrefslogtreecommitdiffstats
path: root/fs/nfs/write.c
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2013-08-13 16:37:37 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-05 10:50:45 -0400
commit8c21c62c4452f4e66c3dac9b3f6b74474fad3e08 (patch)
treec7c5b3edd7dfa21604336c3820e6b859d3cf0fa6 /fs/nfs/write.c
parent3787d5063c52b0c38003e6293f24839508604070 (diff)
nfs4.1: Add SP4_MACH_CRED write and commit support
WRITE and COMMIT can use the machine credential. If WRITE is supported and COMMIT is not, make all (mach cred) writes FILE_SYNC4. Signed-off-by: Weston Andros Adamson <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r--fs/nfs/write.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 379450c8d04..40979e81543 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1022,6 +1022,9 @@ int nfs_initiate_write(struct rpc_clnt *clnt,
data->args.count,
(unsigned long long)data->args.offset);
+ nfs4_state_protect_write(NFS_SERVER(inode)->nfs_client,
+ &task_setup_data.rpc_client, &msg, data);
+
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task)) {
ret = PTR_ERR(task);
@@ -1488,6 +1491,9 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data,
dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid);
+ nfs4_state_protect(NFS_SERVER(data->inode)->nfs_client,
+ NFS_SP4_MACH_CRED_COMMIT, &task_setup_data.rpc_client, &msg);
+
task = rpc_run_task(&task_setup_data);
if (IS_ERR(task))
return PTR_ERR(task);