SUNRPC: Export svc_xprt_received()
[ Upstream commit 7dcfbd86adc45f6d6b37278efd22530cf80ab474 ] Prepare svc_xprt_received() to be called from transport code instead of from generic RPC server code. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
c84c0d4e8d
commit
aa29daf2f0
3 changed files with 11 additions and 4 deletions
|
@ -130,6 +130,7 @@ void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
|
||||||
int svc_create_xprt(struct svc_serv *, const char *, struct net *,
|
int svc_create_xprt(struct svc_serv *, const char *, struct net *,
|
||||||
const int, const unsigned short, int,
|
const int, const unsigned short, int,
|
||||||
const struct cred *);
|
const struct cred *);
|
||||||
|
void svc_xprt_received(struct svc_xprt *xprt);
|
||||||
void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
void svc_xprt_do_enqueue(struct svc_xprt *xprt);
|
||||||
void svc_xprt_enqueue(struct svc_xprt *xprt);
|
void svc_xprt_enqueue(struct svc_xprt *xprt);
|
||||||
void svc_xprt_put(struct svc_xprt *xprt);
|
void svc_xprt_put(struct svc_xprt *xprt);
|
||||||
|
|
|
@ -1756,6 +1756,7 @@ DECLARE_EVENT_CLASS(svc_xprt_event,
|
||||||
), \
|
), \
|
||||||
TP_ARGS(xprt))
|
TP_ARGS(xprt))
|
||||||
|
|
||||||
|
DEFINE_SVC_XPRT_EVENT(received);
|
||||||
DEFINE_SVC_XPRT_EVENT(no_write_space);
|
DEFINE_SVC_XPRT_EVENT(no_write_space);
|
||||||
DEFINE_SVC_XPRT_EVENT(close);
|
DEFINE_SVC_XPRT_EVENT(close);
|
||||||
DEFINE_SVC_XPRT_EVENT(detach);
|
DEFINE_SVC_XPRT_EVENT(detach);
|
||||||
|
|
|
@ -233,21 +233,25 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl,
|
||||||
return xprt;
|
return xprt;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* svc_xprt_received conditionally queues the transport for processing
|
* svc_xprt_received - start next receiver thread
|
||||||
* by another thread. The caller must hold the XPT_BUSY bit and must
|
* @xprt: controlling transport
|
||||||
|
*
|
||||||
|
* The caller must hold the XPT_BUSY bit and must
|
||||||
* not thereafter touch transport data.
|
* not thereafter touch transport data.
|
||||||
*
|
*
|
||||||
* Note: XPT_DATA only gets cleared when a read-attempt finds no (or
|
* Note: XPT_DATA only gets cleared when a read-attempt finds no (or
|
||||||
* insufficient) data.
|
* insufficient) data.
|
||||||
*/
|
*/
|
||||||
static void svc_xprt_received(struct svc_xprt *xprt)
|
void svc_xprt_received(struct svc_xprt *xprt)
|
||||||
{
|
{
|
||||||
if (!test_bit(XPT_BUSY, &xprt->xpt_flags)) {
|
if (!test_bit(XPT_BUSY, &xprt->xpt_flags)) {
|
||||||
WARN_ONCE(1, "xprt=0x%p already busy!", xprt);
|
WARN_ONCE(1, "xprt=0x%p already busy!", xprt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trace_svc_xprt_received(xprt);
|
||||||
|
|
||||||
/* As soon as we clear busy, the xprt could be closed and
|
/* As soon as we clear busy, the xprt could be closed and
|
||||||
* 'put', so we need a reference to call svc_enqueue_xprt with:
|
* 'put', so we need a reference to call svc_enqueue_xprt with:
|
||||||
*/
|
*/
|
||||||
|
@ -257,6 +261,7 @@ static void svc_xprt_received(struct svc_xprt *xprt)
|
||||||
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt);
|
||||||
svc_xprt_put(xprt);
|
svc_xprt_put(xprt);
|
||||||
}
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(svc_xprt_received);
|
||||||
|
|
||||||
void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new)
|
void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue