aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/sunrpc/xprt.c14
-rw-r--r--net/sunrpc/xprtsock.c1
2 files changed, 14 insertions, 1 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 707806fe1a2..e8d11bd6158 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)
}
/**
+ * xprt_release_rqst_cong - housekeeping when request is complete
+ * @task: RPC request that recently completed
+ *
+ * Useful for transports that require congestion control.
+ */
+void xprt_release_rqst_cong(struct rpc_task *task)
+{
+ __xprt_put_cong(task->tk_xprt, task->tk_rqstp);
+}
+
+/**
* xprt_adjust_cwnd - adjust transport congestion window
* @task: recently completed RPC request used to adjust window
* @result: result code of completed RPC request
@@ -823,7 +834,8 @@ void xprt_release(struct rpc_task *task)
return;
spin_lock_bh(&xprt->transport_lock);
xprt->ops->release_xprt(xprt, task);
- __xprt_put_cong(xprt, req);
+ if (xprt->ops->release_request)
+ xprt->ops->release_request(task);
if (!list_empty(&req->rq_list))
list_del(&req->rq_list);
xprt->last_used = jiffies;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 980f26504f4..6c2f5dcea41 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -1059,6 +1059,7 @@ static struct rpc_xprt_ops xs_udp_ops = {
.send_request = xs_udp_send_request,
.set_retrans_timeout = xprt_set_retrans_timeout_rtt,
.timer = xs_udp_timer,
+ .release_request = xprt_release_rqst_cong,
.close = xs_close,
.destroy = xs_destroy,
};