Commit 92551948 authored by Trond Myklebust's avatar Trond Myklebust

SUNRPC: Remove redundant initialisations of request rq_bytes_sent

Now that we clear the rq_bytes_sent field on unlock, we don't need
to set it on lock, so we just set it once when initialising the request.
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent ca7f33aa
...@@ -205,10 +205,8 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -205,10 +205,8 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
goto out_sleep; goto out_sleep;
} }
xprt->snd_task = task; xprt->snd_task = task;
if (req != NULL) { if (req != NULL)
req->rq_bytes_sent = 0;
req->rq_ntrans++; req->rq_ntrans++;
}
return 1; return 1;
...@@ -263,7 +261,6 @@ int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task) ...@@ -263,7 +261,6 @@ int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task)
} }
if (__xprt_get_cong(xprt, task)) { if (__xprt_get_cong(xprt, task)) {
xprt->snd_task = task; xprt->snd_task = task;
req->rq_bytes_sent = 0;
req->rq_ntrans++; req->rq_ntrans++;
return 1; return 1;
} }
...@@ -300,10 +297,8 @@ static bool __xprt_lock_write_func(struct rpc_task *task, void *data) ...@@ -300,10 +297,8 @@ static bool __xprt_lock_write_func(struct rpc_task *task, void *data)
req = task->tk_rqstp; req = task->tk_rqstp;
xprt->snd_task = task; xprt->snd_task = task;
if (req) { if (req)
req->rq_bytes_sent = 0;
req->rq_ntrans++; req->rq_ntrans++;
}
return true; return true;
} }
...@@ -329,7 +324,6 @@ static bool __xprt_lock_write_cong_func(struct rpc_task *task, void *data) ...@@ -329,7 +324,6 @@ static bool __xprt_lock_write_cong_func(struct rpc_task *task, void *data)
} }
if (__xprt_get_cong(xprt, task)) { if (__xprt_get_cong(xprt, task)) {
xprt->snd_task = task; xprt->snd_task = task;
req->rq_bytes_sent = 0;
req->rq_ntrans++; req->rq_ntrans++;
return true; return true;
} }
...@@ -1210,6 +1204,11 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt) ...@@ -1210,6 +1204,11 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
req->rq_buffer = NULL; req->rq_buffer = NULL;
req->rq_xid = xprt_alloc_xid(xprt); req->rq_xid = xprt_alloc_xid(xprt);
req->rq_connect_cookie = xprt->connect_cookie - 1; req->rq_connect_cookie = xprt->connect_cookie - 1;
req->rq_bytes_sent = 0;
req->rq_snd_buf.len = 0;
req->rq_snd_buf.buflen = 0;
req->rq_rcv_buf.len = 0;
req->rq_rcv_buf.buflen = 0;
req->rq_release_snd_buf = NULL; req->rq_release_snd_buf = NULL;
xprt_reset_majortimeo(req); xprt_reset_majortimeo(req);
dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid, dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid,
......
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