diff options
author | Chuck Lever <cel@citi.umich.edu> | 2005-08-11 16:25:50 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-09-23 12:38:28 -0400 |
commit | c7b2cae8a634015b72941ba2fc6c4bc9b8d3a129 (patch) | |
tree | 95f561877d67eed80a823daa6ef0c00ad1c060eb /net/sunrpc/xprt.c | |
parent | 55aa4f58aa43dc9a51fb80010630d94b96053a2e (diff) |
[PATCH] RPC: separate TCP and UDP write space callbacks
Split the socket write space callback function into a TCP version and UDP
version, eliminating one dependence on the "xprt->stream" variable.
Keep the common pieces of this path in xprt.c so other transports can use
it too.
Test-plan:
Write-intensive workload on a single mount point.
Version: Thu, 11 Aug 2005 16:07:51 -0400
Signed-off-by: Chuck Lever <cel@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/xprt.c')
-rw-r--r-- | net/sunrpc/xprt.c | 34 |
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 | */ | ||
249 | void 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 | */ | ||
264 | void 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 | |||
244 | static void xprt_reset_majortimeo(struct rpc_rqst *req) | 278 | static 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; |