Commit 6ba7db34 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Use nfs41_setup_sequence where appropriate

There is no point in using nfs4_setup_sequence or nfs4_sequence_done
in pure NFSv4.1 functions. We already know that those have sessions...
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c10e4498
...@@ -597,10 +597,11 @@ struct nfs41_call_sync_data { ...@@ -597,10 +597,11 @@ struct nfs41_call_sync_data {
static void nfs41_call_sync_prepare(struct rpc_task *task, void *calldata) static void nfs41_call_sync_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs41_call_sync_data *data = calldata; struct nfs41_call_sync_data *data = calldata;
struct nfs4_session *session = nfs4_get_session(data->seq_server);
dprintk("--> %s data->seq_server %p\n", __func__, data->seq_server); dprintk("--> %s data->seq_server %p\n", __func__, data->seq_server);
if (nfs4_setup_sequence(data->seq_server, data->seq_args, if (nfs41_setup_sequence(session, data->seq_args,
data->seq_res, task)) data->seq_res, task))
return; return;
rpc_call_start(task); rpc_call_start(task);
...@@ -6018,6 +6019,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) ...@@ -6018,6 +6019,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs4_layoutget *lgp = calldata; struct nfs4_layoutget *lgp = calldata;
struct nfs_server *server = NFS_SERVER(lgp->args.inode); struct nfs_server *server = NFS_SERVER(lgp->args.inode);
struct nfs4_session *session = nfs4_get_session(server);
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
/* Note the is a race here, where a CB_LAYOUTRECALL can come in /* Note the is a race here, where a CB_LAYOUTRECALL can come in
...@@ -6025,7 +6027,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata) ...@@ -6025,7 +6027,7 @@ nfs4_layoutget_prepare(struct rpc_task *task, void *calldata)
* However, that is not so catastrophic, and there seems * However, that is not so catastrophic, and there seems
* to be no way to prevent it completely. * to be no way to prevent it completely.
*/ */
if (nfs4_setup_sequence(server, &lgp->args.seq_args, if (nfs41_setup_sequence(session, &lgp->args.seq_args,
&lgp->res.seq_res, task)) &lgp->res.seq_res, task))
return; return;
if (pnfs_choose_layoutget_stateid(&lgp->args.stateid, if (pnfs_choose_layoutget_stateid(&lgp->args.stateid,
...@@ -6047,7 +6049,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata) ...@@ -6047,7 +6049,7 @@ static void nfs4_layoutget_done(struct rpc_task *task, void *calldata)
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
if (!nfs4_sequence_done(task, &lgp->res.seq_res)) if (!nfs41_sequence_done(task, &lgp->res.seq_res))
goto out; goto out;
switch (task->tk_status) { switch (task->tk_status) {
...@@ -6211,7 +6213,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata) ...@@ -6211,7 +6213,7 @@ static void nfs4_layoutreturn_done(struct rpc_task *task, void *calldata)
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
if (!nfs4_sequence_done(task, &lrp->res.seq_res)) if (!nfs41_sequence_done(task, &lrp->res.seq_res))
return; return;
server = NFS_SERVER(lrp->args.inode); server = NFS_SERVER(lrp->args.inode);
...@@ -6360,8 +6362,9 @@ static void nfs4_layoutcommit_prepare(struct rpc_task *task, void *calldata) ...@@ -6360,8 +6362,9 @@ static void nfs4_layoutcommit_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs4_layoutcommit_data *data = calldata; struct nfs4_layoutcommit_data *data = calldata;
struct nfs_server *server = NFS_SERVER(data->args.inode); struct nfs_server *server = NFS_SERVER(data->args.inode);
struct nfs4_session *session = nfs4_get_session(server);
if (nfs4_setup_sequence(server, &data->args.seq_args, if (nfs41_setup_sequence(session, &data->args.seq_args,
&data->res.seq_res, task)) &data->res.seq_res, task))
return; return;
rpc_call_start(task); rpc_call_start(task);
...@@ -6373,7 +6376,7 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata) ...@@ -6373,7 +6376,7 @@ nfs4_layoutcommit_done(struct rpc_task *task, void *calldata)
struct nfs4_layoutcommit_data *data = calldata; struct nfs4_layoutcommit_data *data = calldata;
struct nfs_server *server = NFS_SERVER(data->args.inode); struct nfs_server *server = NFS_SERVER(data->args.inode);
if (!nfs4_sequence_done(task, &data->res.seq_res)) if (!nfs41_sequence_done(task, &data->res.seq_res))
return; return;
switch (task->tk_status) { /* Just ignore these failures */ switch (task->tk_status) { /* Just ignore these failures */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment