aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/xprt.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r--net/sunrpc/xprt.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c
index 247fa1ec870c..31ef7dc7eed6 100644
--- a/net/sunrpc/xprt.c
+++ b/net/sunrpc/xprt.c
@@ -241,6 +241,40 @@ void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status)
241 rpc_wake_up(&xprt->pending); 241 rpc_wake_up(&xprt->pending);
242} 242}
243 243
244/**
245 * xprt_wait_for_buffer_space - wait for transport output buffer to clear
246 * @task: task to be put to sleep
247 *
248 */
249void xprt_wait_for_buffer_space(struct rpc_task *task)
250{
251 struct rpc_rqst *req = task->tk_rqstp;
252 struct rpc_xprt *xprt = req->rq_xprt;
253
254 task->tk_timeout = req->rq_timeout;
255 rpc_sleep_on(&xprt->pending, task, NULL, NULL);
256}
257
258/**
259 * xprt_write_space - wake the task waiting for transport output buffer space
260 * @xprt: transport with waiting tasks
261 *
262 * Can be called in a soft IRQ context, so xprt_write_space never sleeps.
263 */
264void xprt_write_space(struct rpc_xprt *xprt)
265{
266 if (unlikely(xprt->shutdown))
267 return;
268
269 spin_lock_bh(&xprt->transport_lock);
270 if (xprt->snd_task) {
271 dprintk("RPC: write space: waking waiting task on xprt %p\n",
272 xprt);
273 rpc_wake_up_task(xprt->snd_task);
274 }
275 spin_unlock_bh(&xprt->transport_lock);
276}
277
244static void xprt_reset_majortimeo(struct rpc_rqst *req) 278static void xprt_reset_majortimeo(struct rpc_rqst *req)
245{ 279{
246 struct rpc_timeout *to = &req->rq_xprt->timeout; 280 struct rpc_timeout *to = &req->rq_xprt->timeout;