Skip to content

Commit cea5778

Browse files
author
Trond Myklebust
committed
SUNRPC: Clean up
Replace remaining callers of call_timeout() with rpc_check_timeout(). Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent 7b3fef8 commit cea5778

File tree

1 file changed

+14
-33
lines changed

1 file changed

+14
-33
lines changed

net/sunrpc/clnt.c

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ static void call_status(struct rpc_task *task);
7070
static void call_transmit_status(struct rpc_task *task);
7171
static void call_refresh(struct rpc_task *task);
7272
static void call_refreshresult(struct rpc_task *task);
73-
static void call_timeout(struct rpc_task *task);
7473
static void call_connect(struct rpc_task *task);
7574
static void call_connect_status(struct rpc_task *task);
7675

@@ -1908,7 +1907,8 @@ call_bind_status(struct rpc_task *task)
19081907

19091908
retry_timeout:
19101909
task->tk_status = 0;
1911-
task->tk_action = call_timeout;
1910+
task->tk_action = call_encode;
1911+
rpc_check_timeout(task);
19121912
}
19131913

19141914
/*
@@ -2197,18 +2197,15 @@ call_status(struct rpc_task *task)
21972197
case -EHOSTUNREACH:
21982198
case -ENETUNREACH:
21992199
case -EPERM:
2200-
if (RPC_IS_SOFTCONN(task)) {
2201-
rpc_exit(task, status);
2202-
break;
2203-
}
2200+
if (RPC_IS_SOFTCONN(task))
2201+
goto out_exit;
22042202
/*
22052203
* Delay any retries for 3 seconds, then handle as if it
22062204
* were a timeout.
22072205
*/
22082206
rpc_delay(task, 3*HZ);
22092207
/* fall through */
22102208
case -ETIMEDOUT:
2211-
task->tk_action = call_timeout;
22122209
break;
22132210
case -ECONNREFUSED:
22142211
case -ECONNRESET:
@@ -2221,18 +2218,21 @@ call_status(struct rpc_task *task)
22212218
case -EPIPE:
22222219
case -ENOTCONN:
22232220
case -EAGAIN:
2224-
task->tk_action = call_timeout;
22252221
break;
22262222
case -EIO:
22272223
/* shutdown or soft timeout */
2228-
rpc_exit(task, status);
2229-
break;
2224+
goto out_exit;
22302225
default:
22312226
if (clnt->cl_chatty)
22322227
printk("%s: RPC call returned error %d\n",
22332228
clnt->cl_program->name, -status);
2234-
rpc_exit(task, status);
2229+
goto out_exit;
22352230
}
2231+
task->tk_action = call_encode;
2232+
rpc_check_timeout(task);
2233+
return;
2234+
out_exit:
2235+
rpc_exit(task, status);
22362236
}
22372237

22382238
static void
@@ -2279,19 +2279,6 @@ rpc_check_timeout(struct rpc_task *task)
22792279
rpcauth_invalcred(task);
22802280
}
22812281

2282-
/*
2283-
* 6a. Handle RPC timeout
2284-
* We do not release the request slot, so we keep using the
2285-
* same XID for all retransmits.
2286-
*/
2287-
static void
2288-
call_timeout(struct rpc_task *task)
2289-
{
2290-
task->tk_action = call_encode;
2291-
task->tk_status = 0;
2292-
rpc_check_timeout(task);
2293-
}
2294-
22952282
/*
22962283
* 7. Decode the RPC reply
22972284
*/
@@ -2329,16 +2316,8 @@ call_decode(struct rpc_task *task)
23292316
WARN_ON(memcmp(&req->rq_rcv_buf, &req->rq_private_buf,
23302317
sizeof(req->rq_rcv_buf)) != 0);
23312318

2332-
if (req->rq_rcv_buf.len < 12) {
2333-
if (!RPC_IS_SOFT(task)) {
2334-
task->tk_action = call_encode;
2335-
goto out_retry;
2336-
}
2337-
dprintk("RPC: %s: too small RPC reply size (%d bytes)\n",
2338-
clnt->cl_program->name, task->tk_status);
2339-
task->tk_action = call_timeout;
2319+
if (req->rq_rcv_buf.len < 12)
23402320
goto out_retry;
2341-
}
23422321

23432322
xdr_init_decode(&xdr, &req->rq_rcv_buf,
23442323
req->rq_rcv_buf.head[0].iov_base, req);
@@ -2361,6 +2340,8 @@ call_decode(struct rpc_task *task)
23612340
xprt_conditional_disconnect(req->rq_xprt,
23622341
req->rq_connect_cookie);
23632342
}
2343+
task->tk_action = call_encode;
2344+
rpc_check_timeout(task);
23642345
}
23652346
}
23662347

0 commit comments

Comments
 (0)