Commit b3ef8b3b authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Allow rpc_init_task() to initialise the rpc_task->tk_msg

In preparation for the removal of rpc_call_setup().
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 77de2c59
...@@ -540,13 +540,10 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *task_setup_data) ...@@ -540,13 +540,10 @@ struct rpc_task *rpc_run_task(const struct rpc_task_setup *task_setup_data)
goto out; goto out;
} }
if (task_setup_data->rpc_message != NULL) { if (task->tk_status != 0) {
rpc_call_setup(task, task_setup_data->rpc_message, 0); ret = ERR_PTR(task->tk_status);
if (task->tk_status != 0) { rpc_put_task(task);
ret = ERR_PTR(task->tk_status); goto out;
rpc_put_task(task);
goto out;
}
} }
atomic_inc(&task->tk_count); atomic_inc(&task->tk_count);
/* Mask signals on synchronous RPC calls and RPCSEC_GSS upcalls */ /* Mask signals on synchronous RPC calls and RPCSEC_GSS upcalls */
......
...@@ -848,6 +848,17 @@ void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *task_setu ...@@ -848,6 +848,17 @@ void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *task_setu
if (task->tk_ops->rpc_call_prepare != NULL) if (task->tk_ops->rpc_call_prepare != NULL)
task->tk_action = rpc_prepare_task; task->tk_action = rpc_prepare_task;
if (task_setup_data->rpc_message != NULL) {
memcpy(&task->tk_msg, task_setup_data->rpc_message, sizeof(task->tk_msg));
/* Bind the user cred */
if (task->tk_msg.rpc_cred != NULL)
rpcauth_holdcred(task);
else
rpcauth_bindcred(task);
if (task->tk_action == NULL)
rpc_call_start(task);
}
/* starting timestamp */ /* starting timestamp */
task->tk_start = jiffies; task->tk_start = jiffies;
......
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