sunrpc: remove unnecessary test in rpc_task_set_client()
[ Upstream commit 023859ce6f88f7cfc223752fb56ec453a147b852 ] In rpc_task_set_client(), testing for a NULL clnt is not necessary, as clnt should always be a valid pointer to a rpc_client. Signed-off-by: Thiago Rafael Becker <trbecker@gmail.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Stable-dep-of: 4db9ad82a6c8 ("sunrpc: clear XPRT_SOCK_UPD_TIMEOUT when reset transport") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
1cc85c0637
commit
71706e5ed7
1 changed files with 15 additions and 18 deletions
|
@ -1077,24 +1077,21 @@ void rpc_task_set_transport(struct rpc_task *task, struct rpc_clnt *clnt)
|
||||||
static
|
static
|
||||||
void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt)
|
void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt)
|
||||||
{
|
{
|
||||||
|
rpc_task_set_transport(task, clnt);
|
||||||
if (clnt != NULL) {
|
task->tk_client = clnt;
|
||||||
rpc_task_set_transport(task, clnt);
|
refcount_inc(&clnt->cl_count);
|
||||||
task->tk_client = clnt;
|
if (clnt->cl_softrtry)
|
||||||
refcount_inc(&clnt->cl_count);
|
task->tk_flags |= RPC_TASK_SOFT;
|
||||||
if (clnt->cl_softrtry)
|
if (clnt->cl_softerr)
|
||||||
task->tk_flags |= RPC_TASK_SOFT;
|
task->tk_flags |= RPC_TASK_TIMEOUT;
|
||||||
if (clnt->cl_softerr)
|
if (clnt->cl_noretranstimeo)
|
||||||
task->tk_flags |= RPC_TASK_TIMEOUT;
|
task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT;
|
||||||
if (clnt->cl_noretranstimeo)
|
if (atomic_read(&clnt->cl_swapper))
|
||||||
task->tk_flags |= RPC_TASK_NO_RETRANS_TIMEOUT;
|
task->tk_flags |= RPC_TASK_SWAPPER;
|
||||||
if (atomic_read(&clnt->cl_swapper))
|
/* Add to the client's list of all tasks */
|
||||||
task->tk_flags |= RPC_TASK_SWAPPER;
|
spin_lock(&clnt->cl_lock);
|
||||||
/* Add to the client's list of all tasks */
|
list_add_tail(&task->tk_task, &clnt->cl_tasks);
|
||||||
spin_lock(&clnt->cl_lock);
|
spin_unlock(&clnt->cl_lock);
|
||||||
list_add_tail(&task->tk_task, &clnt->cl_tasks);
|
|
||||||
spin_unlock(&clnt->cl_lock);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Add table
Reference in a new issue