diff options
| author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-03-09 16:06:47 -0500 |
|---|---|---|
| committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2019-03-09 16:22:58 -0500 |
| commit | cea57789e4081870ac3498fbefabbbd0d0fd8434 (patch) | |
| tree | 7213d94457c65a60ce57cf6274b0d046c9ded1a5 | |
| parent | 7b3fef8e4157ed424bcde039a60a730aa0dfb0eb (diff) | |
SUNRPC: Clean up
Replace remaining callers of call_timeout() with rpc_check_timeout().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
| -rw-r--r-- | net/sunrpc/clnt.c | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 311029b7c33a..a0e7322fc171 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
| @@ -70,7 +70,6 @@ static void call_status(struct rpc_task *task); | |||
| 70 | static void call_transmit_status(struct rpc_task *task); | 70 | static void call_transmit_status(struct rpc_task *task); |
| 71 | static void call_refresh(struct rpc_task *task); | 71 | static void call_refresh(struct rpc_task *task); |
| 72 | static void call_refreshresult(struct rpc_task *task); | 72 | static void call_refreshresult(struct rpc_task *task); |
| 73 | static void call_timeout(struct rpc_task *task); | ||
| 74 | static void call_connect(struct rpc_task *task); | 73 | static void call_connect(struct rpc_task *task); |
| 75 | static void call_connect_status(struct rpc_task *task); | 74 | static void call_connect_status(struct rpc_task *task); |
| 76 | 75 | ||
| @@ -1908,7 +1907,8 @@ call_bind_status(struct rpc_task *task) | |||
| 1908 | 1907 | ||
| 1909 | retry_timeout: | 1908 | retry_timeout: |
| 1910 | task->tk_status = 0; | 1909 | task->tk_status = 0; |
| 1911 | task->tk_action = call_timeout; | 1910 | task->tk_action = call_encode; |
| 1911 | rpc_check_timeout(task); | ||
| 1912 | } | 1912 | } |
| 1913 | 1913 | ||
| 1914 | /* | 1914 | /* |
| @@ -2197,10 +2197,8 @@ call_status(struct rpc_task *task) | |||
| 2197 | case -EHOSTUNREACH: | 2197 | case -EHOSTUNREACH: |
| 2198 | case -ENETUNREACH: | 2198 | case -ENETUNREACH: |
| 2199 | case -EPERM: | 2199 | case -EPERM: |
| 2200 | if (RPC_IS_SOFTCONN(task)) { | 2200 | if (RPC_IS_SOFTCONN(task)) |
| 2201 | rpc_exit(task, status); | 2201 | goto out_exit; |
| 2202 | break; | ||
| 2203 | } | ||
| 2204 | /* | 2202 | /* |
| 2205 | * Delay any retries for 3 seconds, then handle as if it | 2203 | * Delay any retries for 3 seconds, then handle as if it |
| 2206 | * were a timeout. | 2204 | * were a timeout. |
| @@ -2208,7 +2206,6 @@ call_status(struct rpc_task *task) | |||
| 2208 | rpc_delay(task, 3*HZ); | 2206 | rpc_delay(task, 3*HZ); |
| 2209 | /* fall through */ | 2207 | /* fall through */ |
| 2210 | case -ETIMEDOUT: | 2208 | case -ETIMEDOUT: |
| 2211 | task->tk_action = call_timeout; | ||
| 2212 | break; | 2209 | break; |
| 2213 | case -ECONNREFUSED: | 2210 | case -ECONNREFUSED: |
| 2214 | case -ECONNRESET: | 2211 | case -ECONNRESET: |
| @@ -2221,18 +2218,21 @@ call_status(struct rpc_task *task) | |||
| 2221 | case -EPIPE: | 2218 | case -EPIPE: |
| 2222 | case -ENOTCONN: | 2219 | case -ENOTCONN: |
| 2223 | case -EAGAIN: | 2220 | case -EAGAIN: |
| 2224 | task->tk_action = call_timeout; | ||
| 2225 | break; | 2221 | break; |
| 2226 | case -EIO: | 2222 | case -EIO: |
| 2227 | /* shutdown or soft timeout */ | 2223 | /* shutdown or soft timeout */ |
| 2228 | rpc_exit(task, status); | 2224 | goto out_exit; |
| 2229 | break; | ||
| 2230 | default: | 2225 | default: |
| 2231 | if (clnt->cl_chatty) | 2226 | if (clnt->cl_chatty) |
| 2232 | printk("%s: RPC call returned error %d\n", | 2227 | printk("%s: RPC call returned error %d\n", |
| 2233 | clnt->cl_program->name, -status); | 2228 | clnt->cl_program->name, -status); |
| 2234 | rpc_exit(task, status); | 2229 | goto out_exit; |
| 2235 | } | 2230 | } |
| 2231 | task->tk_action = call_encode; | ||
| 2232 | rpc_check_timeout(task); | ||
| 2233 | return; | ||
| 2234 | out_exit: | ||
| 2235 | rpc_exit(task, status); | ||
| 2236 | } | 2236 | } |
| 2237 | 2237 | ||
| 2238 | static void | 2238 | static void |
| @@ -2280,19 +2280,6 @@ rpc_check_timeout(struct rpc_task *task) | |||
| 2280 | } | 2280 | } |
| 2281 | 2281 | ||
| 2282 | /* | 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 | |||
| 2295 | /* | ||
| 2296 | * 7. Decode the RPC reply | 2283 | * 7. Decode the RPC reply |
| 2297 | */ | 2284 | */ |
| 2298 | static void | 2285 | static void |
| @@ -2329,16 +2316,8 @@ call_decode(struct rpc_task *task) | |||
| 2329 | WARN_ON(memcmp(&req->rq_rcv_buf, &req->rq_private_buf, | 2316 | WARN_ON(memcmp(&req->rq_rcv_buf, &req->rq_private_buf, |
| 2330 | sizeof(req->rq_rcv_buf)) != 0); | 2317 | sizeof(req->rq_rcv_buf)) != 0); |
| 2331 | 2318 | ||
| 2332 | if (req->rq_rcv_buf.len < 12) { | 2319 | 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; | ||
| 2340 | goto out_retry; | 2320 | goto out_retry; |
| 2341 | } | ||
| 2342 | 2321 | ||
| 2343 | xdr_init_decode(&xdr, &req->rq_rcv_buf, | 2322 | xdr_init_decode(&xdr, &req->rq_rcv_buf, |
| 2344 | req->rq_rcv_buf.head[0].iov_base, req); | 2323 | req->rq_rcv_buf.head[0].iov_base, req); |
| @@ -2361,6 +2340,8 @@ out_retry: | |||
| 2361 | xprt_conditional_disconnect(req->rq_xprt, | 2340 | xprt_conditional_disconnect(req->rq_xprt, |
| 2362 | req->rq_connect_cookie); | 2341 | req->rq_connect_cookie); |
| 2363 | } | 2342 | } |
| 2343 | task->tk_action = call_encode; | ||
| 2344 | rpc_check_timeout(task); | ||
| 2364 | } | 2345 | } |
| 2365 | } | 2346 | } |
| 2366 | 2347 | ||
