nfsd/sunrpc: turn enqueueing a svc_xprt into a svc_serv operation
For now, all services use svc_xprt_do_enqueue, but once we add workqueue-based service support, we'll need to do something different. Signed-off-by: Shirley Ma <shirley.ma@oracle.com> Acked-by: Jeff Layton <jlayton@primarydata.com> Tested-by: Shirley Ma <shirley.ma@oracle.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:

committed by
J. Bruce Fields

parent
758f62fff9
commit
b9e13cdfac
@@ -24,7 +24,6 @@ static int svc_deferred_recv(struct svc_rqst *rqstp);
|
||||
static struct cache_deferred_req *svc_defer(struct cache_req *req);
|
||||
static void svc_age_temp_xprts(unsigned long closure);
|
||||
static void svc_delete_xprt(struct svc_xprt *xprt);
|
||||
static void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
||||
|
||||
/* apparently the "standard" is that clients close
|
||||
* idle connections after 5 minutes, servers after
|
||||
@@ -225,12 +224,12 @@ static void svc_xprt_received(struct svc_xprt *xprt)
|
||||
}
|
||||
|
||||
/* As soon as we clear busy, the xprt could be closed and
|
||||
* 'put', so we need a reference to call svc_xprt_do_enqueue with:
|
||||
* 'put', so we need a reference to call svc_enqueue_xprt with:
|
||||
*/
|
||||
svc_xprt_get(xprt);
|
||||
smp_mb__before_atomic();
|
||||
clear_bit(XPT_BUSY, &xprt->xpt_flags);
|
||||
svc_xprt_do_enqueue(xprt);
|
||||
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
||||
svc_xprt_put(xprt);
|
||||
}
|
||||
|
||||
@@ -320,7 +319,7 @@ static bool svc_xprt_has_something_to_do(struct svc_xprt *xprt)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void svc_xprt_do_enqueue(struct svc_xprt *xprt)
|
||||
void svc_xprt_do_enqueue(struct svc_xprt *xprt)
|
||||
{
|
||||
struct svc_pool *pool;
|
||||
struct svc_rqst *rqstp = NULL;
|
||||
@@ -402,6 +401,7 @@ redo_search:
|
||||
out:
|
||||
trace_svc_xprt_do_enqueue(xprt, rqstp);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(svc_xprt_do_enqueue);
|
||||
|
||||
/*
|
||||
* Queue up a transport with data pending. If there are idle nfsd
|
||||
@@ -412,7 +412,7 @@ void svc_xprt_enqueue(struct svc_xprt *xprt)
|
||||
{
|
||||
if (test_bit(XPT_BUSY, &xprt->xpt_flags))
|
||||
return;
|
||||
svc_xprt_do_enqueue(xprt);
|
||||
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(svc_xprt_enqueue);
|
||||
|
||||
|
Reference in New Issue
Block a user