Skip to content

Commit 6741019

Browse files
author
J. Bruce Fields
committed
svcrpc: make svc_xprt_received static
Note this isn't used outside svc_xprt.c. May as well move it so we don't need a declaration while we're here. Also remove an outdated comment. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
1 parent 5b444cc commit 6741019

3 files changed

Lines changed: 20 additions & 26 deletions

File tree

‎include/linux/sunrpc/svc_xprt.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *,
114114
int svc_create_xprt(struct svc_serv *, const char *, struct net *,
115115
const int, const unsigned short, int);
116116
void svc_xprt_enqueue(struct svc_xprt *xprt);
117-
void svc_xprt_received(struct svc_xprt *);
118117
void svc_xprt_put(struct svc_xprt *xprt);
119118
void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt);
120119
void svc_close_xprt(struct svc_xprt *xprt);

‎net/sunrpc/svc_xprt.c‎

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,26 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl,
208208
return xcl->xcl_ops->xpo_create(serv, net, sap, len, flags);
209209
}
210210

211+
/*
212+
* svc_xprt_received conditionally queues the transport for processing
213+
* by another thread. The caller must hold the XPT_BUSY bit and must
214+
* not thereafter touch transport data.
215+
*
216+
* Note: XPT_DATA only gets cleared when a read-attempt finds no (or
217+
* insufficient) data.
218+
*/
219+
static void svc_xprt_received(struct svc_xprt *xprt)
220+
{
221+
BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags));
222+
/* As soon as we clear busy, the xprt could be closed and
223+
* 'put', so we need a reference to call svc_xprt_enqueue with:
224+
*/
225+
svc_xprt_get(xprt);
226+
clear_bit(XPT_BUSY, &xprt->xpt_flags);
227+
svc_xprt_enqueue(xprt);
228+
svc_xprt_put(xprt);
229+
}
230+
211231
void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new)
212232
{
213233
clear_bit(XPT_TEMP, &new->xpt_flags);
@@ -398,27 +418,6 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_pool *pool)
398418
return xprt;
399419
}
400420

401-
/*
402-
* svc_xprt_received conditionally queues the transport for processing
403-
* by another thread. The caller must hold the XPT_BUSY bit and must
404-
* not thereafter touch transport data.
405-
*
406-
* Note: XPT_DATA only gets cleared when a read-attempt finds no (or
407-
* insufficient) data.
408-
*/
409-
void svc_xprt_received(struct svc_xprt *xprt)
410-
{
411-
BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags));
412-
/* As soon as we clear busy, the xprt could be closed and
413-
* 'put', so we need a reference to call svc_xprt_enqueue with:
414-
*/
415-
svc_xprt_get(xprt);
416-
clear_bit(XPT_BUSY, &xprt->xpt_flags);
417-
svc_xprt_enqueue(xprt);
418-
svc_xprt_put(xprt);
419-
}
420-
EXPORT_SYMBOL_GPL(svc_xprt_received);
421-
422421
/**
423422
* svc_reserve - change the space reserved for the reply to a request.
424423
* @rqstp: The request in question

‎net/sunrpc/xprtrdma/svc_rdma_transport.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,6 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id, size_t client_ird)
578578
list_add_tail(&newxprt->sc_accept_q, &listen_xprt->sc_accept_q);
579579
spin_unlock_bh(&listen_xprt->sc_lock);
580580

581-
/*
582-
* Can't use svc_xprt_received here because we are not on a
583-
* rqstp thread
584-
*/
585581
set_bit(XPT_CONN, &listen_xprt->sc_xprt.xpt_flags);
586582
svc_xprt_enqueue(&listen_xprt->sc_xprt);
587583
}

0 commit comments

Comments
 (0)