aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2013-08-09 12:49:38 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-03 15:26:37 -0400
commitfbd4bfd1d9d21664a1c2a6730e8bc1a577f1e171 (patch)
tree1e5aacf760cc6876f38277d868c78282ea4409fe /fs/nfs
parent160881e33d88129faeb08130865fdc0177ba1aa3 (diff)
NFS: Add nfs4_sequence calls for RELEASE_LOCKOWNER
Ensure RELEASE_LOCKOWNER is not emitted while the transport is plugged. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4proc.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 6807e9b8b593..5ad48f0ce841 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5725,8 +5725,23 @@ struct nfs_release_lockowner_data {
5725 struct nfs4_lock_state *lsp; 5725 struct nfs4_lock_state *lsp;
5726 struct nfs_server *server; 5726 struct nfs_server *server;
5727 struct nfs_release_lockowner_args args; 5727 struct nfs_release_lockowner_args args;
5728 struct nfs4_sequence_args seq_args;
5729 struct nfs4_sequence_res seq_res;
5728}; 5730};
5729 5731
5732static void nfs4_release_lockowner_prepare(struct rpc_task *task, void *calldata)
5733{
5734 struct nfs_release_lockowner_data *data = calldata;
5735 nfs40_setup_sequence(data->server,
5736 &data->seq_args, &data->seq_res, task);
5737}
5738
5739static void nfs4_release_lockowner_done(struct rpc_task *task, void *calldata)
5740{
5741 struct nfs_release_lockowner_data *data = calldata;
5742 nfs40_sequence_done(task, &data->seq_res);
5743}
5744
5730static void nfs4_release_lockowner_release(void *calldata) 5745static void nfs4_release_lockowner_release(void *calldata)
5731{ 5746{
5732 struct nfs_release_lockowner_data *data = calldata; 5747 struct nfs_release_lockowner_data *data = calldata;
@@ -5735,6 +5750,8 @@ static void nfs4_release_lockowner_release(void *calldata)
5735} 5750}
5736 5751
5737static const struct rpc_call_ops nfs4_release_lockowner_ops = { 5752static const struct rpc_call_ops nfs4_release_lockowner_ops = {
5753 .rpc_call_prepare = nfs4_release_lockowner_prepare,
5754 .rpc_call_done = nfs4_release_lockowner_done,
5738 .rpc_release = nfs4_release_lockowner_release, 5755 .rpc_release = nfs4_release_lockowner_release,
5739}; 5756};
5740 5757
@@ -5747,14 +5764,17 @@ static int nfs4_release_lockowner(struct nfs_server *server, struct nfs4_lock_st
5747 5764
5748 if (server->nfs_client->cl_mvops->minor_version != 0) 5765 if (server->nfs_client->cl_mvops->minor_version != 0)
5749 return -EINVAL; 5766 return -EINVAL;
5767
5750 data = kmalloc(sizeof(*data), GFP_NOFS); 5768 data = kmalloc(sizeof(*data), GFP_NOFS);
5751 if (!data) 5769 if (!data)
5752 return -ENOMEM; 5770 return -ENOMEM;
5771 nfs4_init_sequence(&data->seq_args, &data->seq_res, 0);
5753 data->lsp = lsp; 5772 data->lsp = lsp;
5754 data->server = server; 5773 data->server = server;
5755 data->args.lock_owner.clientid = server->nfs_client->cl_clientid; 5774 data->args.lock_owner.clientid = server->nfs_client->cl_clientid;
5756 data->args.lock_owner.id = lsp->ls_seqid.owner_id; 5775 data->args.lock_owner.id = lsp->ls_seqid.owner_id;
5757 data->args.lock_owner.s_dev = server->s_dev; 5776 data->args.lock_owner.s_dev = server->s_dev;
5777
5758 msg.rpc_argp = &data->args; 5778 msg.rpc_argp = &data->args;
5759 rpc_call_async(server->client, &msg, 0, &nfs4_release_lockowner_ops, data); 5779 rpc_call_async(server->client, &msg, 0, &nfs4_release_lockowner_ops, data);
5760 return 0; 5780 return 0;