aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2013-09-27 11:28:40 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-01 18:22:11 -0400
commit92551948174d079b12541437f51cbe3e17d9dd24 (patch)
treea831008dba83fac12e3aa438226f919794e7dfa4 /net
parentca7f33aa5b8051f17eec81766b8f39c83caf4196 (diff)
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: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprt.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index d166d9947e36..4953550537e0 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -205,10 +205,8 @@ int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task)
205 goto out_sleep; 205 goto out_sleep;
206 } 206 }
207 xprt->snd_task = task; 207 xprt->snd_task = task;
208 if (req != NULL) { 208 if (req != NULL)
209 req->rq_bytes_sent = 0;
210 req->rq_ntrans++; 209 req->rq_ntrans++;
211 }
212 210
213 return 1; 211 return 1;
214 212
@@ -263,7 +261,6 @@ int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task)
263 } 261 }
264 if (__xprt_get_cong(xprt, task)) { 262 if (__xprt_get_cong(xprt, task)) {
265 xprt->snd_task = task; 263 xprt->snd_task = task;
266 req->rq_bytes_sent = 0;
267 req->rq_ntrans++; 264 req->rq_ntrans++;
268 return 1; 265 return 1;
269 } 266 }
@@ -300,10 +297,8 @@ static bool __xprt_lock_write_func(struct rpc_task *task, void *data)
300 297
301 req = task->tk_rqstp; 298 req = task->tk_rqstp;
302 xprt->snd_task = task; 299 xprt->snd_task = task;
303 if (req) { 300 if (req)
304 req->rq_bytes_sent = 0;
305 req->rq_ntrans++; 301 req->rq_ntrans++;
306 }
307 return true; 302 return true;
308} 303}
309 304
@@ -329,7 +324,6 @@ static bool __xprt_lock_write_cong_func(struct rpc_task *task, void *data)
329 } 324 }
330 if (__xprt_get_cong(xprt, task)) { 325 if (__xprt_get_cong(xprt, task)) {
331 xprt->snd_task = task; 326 xprt->snd_task = task;
332 req->rq_bytes_sent = 0;
333 req->rq_ntrans++; 327 req->rq_ntrans++;
334 return true; 328 return true;
335 } 329 }
@@ -1210,6 +1204,11 @@ static void xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
1210 req->rq_buffer = NULL; 1204 req->rq_buffer = NULL;
1211 req->rq_xid = xprt_alloc_xid(xprt); 1205 req->rq_xid = xprt_alloc_xid(xprt);
1212 req->rq_connect_cookie = xprt->connect_cookie - 1; 1206 req->rq_connect_cookie = xprt->connect_cookie - 1;
1207 req->rq_bytes_sent = 0;
1208 req->rq_snd_buf.len = 0;
1209 req->rq_snd_buf.buflen = 0;
1210 req->rq_rcv_buf.len = 0;
1211 req->rq_rcv_buf.buflen = 0;
1213 req->rq_release_snd_buf = NULL; 1212 req->rq_release_snd_buf = NULL;
1214 xprt_reset_majortimeo(req); 1213 xprt_reset_majortimeo(req);
1215 dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid, 1214 dprintk("RPC: %5u reserved req %p xid %08x\n", task->tk_pid,