aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/xprt.h2
-rw-r--r--net/sunrpc/xprt.c14
-rw-r--r--net/sunrpc/xprtsock.c1
3 files changed, 16 insertions, 1 deletions
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 2e48752d55d9..64e77658fa30 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -138,6 +138,7 @@ struct rpc_xprt_ops {
138 int (*send_request)(struct rpc_task *task); 138 int (*send_request)(struct rpc_task *task);
139 void (*set_retrans_timeout)(struct rpc_task *task); 139 void (*set_retrans_timeout)(struct rpc_task *task);
140 void (*timer)(struct rpc_task *task); 140 void (*timer)(struct rpc_task *task);
141 void (*release_request)(struct rpc_task *task);
141 void (*close)(struct rpc_xprt *xprt); 142 void (*close)(struct rpc_xprt *xprt);
142 void (*destroy)(struct rpc_xprt *xprt); 143 void (*destroy)(struct rpc_xprt *xprt);
143}; 144};
@@ -262,6 +263,7 @@ void xprt_update_rtt(struct rpc_task *task);
262void xprt_adjust_cwnd(struct rpc_task *task, int result); 263void xprt_adjust_cwnd(struct rpc_task *task, int result);
263struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); 264struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid);
264void xprt_complete_rqst(struct rpc_task *task, int copied); 265void xprt_complete_rqst(struct rpc_task *task, int copied);
266void xprt_release_rqst_cong(struct rpc_task *task);
265void xprt_disconnect(struct rpc_xprt *xprt); 267void xprt_disconnect(struct rpc_xprt *xprt);
266 268
267/* 269/*
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 707806fe1a23..e8d11bd6158e 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -290,6 +290,17 @@ __xprt_put_cong(struct rpc_xprt *xprt, struct rpc_rqst *req)
290} 290}
291 291
292/** 292/**
293 * xprt_release_rqst_cong - housekeeping when request is complete
294 * @task: RPC request that recently completed
295 *
296 * Useful for transports that require congestion control.
297 */
298void xprt_release_rqst_cong(struct rpc_task *task)
299{
300 __xprt_put_cong(task->tk_xprt, task->tk_rqstp);
301}
302
303/**
293 * xprt_adjust_cwnd - adjust transport congestion window 304 * xprt_adjust_cwnd - adjust transport congestion window
294 * @task: recently completed RPC request used to adjust window 305 * @task: recently completed RPC request used to adjust window
295 * @result: result code of completed RPC request 306 * @result: result code of completed RPC request
@@ -823,7 +834,8 @@ void xprt_release(struct rpc_task *task)
823 return; 834 return;
824 spin_lock_bh(&xprt->transport_lock); 835 spin_lock_bh(&xprt->transport_lock);
825 xprt->ops->release_xprt(xprt, task); 836 xprt->ops->release_xprt(xprt, task);
826 __xprt_put_cong(xprt, req); 837 if (xprt->ops->release_request)
838 xprt->ops->release_request(task);
827 if (!list_empty(&req->rq_list)) 839 if (!list_empty(&req->rq_list))
828 list_del(&req->rq_list); 840 list_del(&req->rq_list);
829 xprt->last_used = jiffies; 841 xprt->last_used = jiffies;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 980f26504f48..6c2f5dcea416 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1059,6 +1059,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
1059 .send_request = xs_udp_send_request, 1059 .send_request = xs_udp_send_request,
1060 .set_retrans_timeout = xprt_set_retrans_timeout_rtt, 1060 .set_retrans_timeout = xprt_set_retrans_timeout_rtt,
1061 .timer = xs_udp_timer, 1061 .timer = xs_udp_timer,
1062 .release_request = xprt_release_rqst_cong,
1062 .close = xs_close, 1063 .close = xs_close,
1063 .destroy = xs_destroy, 1064 .destroy = xs_destroy,
1064}; 1065};