diff options
| author | J. Bruce Fields <bfields@redhat.com> | 2012-08-17 22:12:19 -0400 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2012-08-21 17:42:01 -0400 |
| commit | 6741019c829ecfa6f7a504fae1305dcf5d5cf057 (patch) | |
| tree | a0b749e9ccab9d0bb813ff8b92fde629d40e4bc4 | |
| parent | 5b444cc9a4c979aa0fa185c8ddca221462a34b7a (diff) | |
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>
| -rw-r--r-- | include/linux/sunrpc/svc_xprt.h | 1 | ||||
| -rw-r--r-- | net/sunrpc/svc_xprt.c | 41 | ||||
| -rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 4 |
3 files changed, 20 insertions, 26 deletions
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 193dddab6511..b05963f09ebf 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
| @@ -114,7 +114,6 @@ void svc_xprt_init(struct net *, struct svc_xprt_class *, struct svc_xprt *, | |||
| 114 | int svc_create_xprt(struct svc_serv *, const char *, struct net *, | 114 | int svc_create_xprt(struct svc_serv *, const char *, struct net *, |
| 115 | const int, const unsigned short, int); | 115 | const int, const unsigned short, int); |
| 116 | void svc_xprt_enqueue(struct svc_xprt *xprt); | 116 | void svc_xprt_enqueue(struct svc_xprt *xprt); |
| 117 | void svc_xprt_received(struct svc_xprt *); | ||
| 118 | void svc_xprt_put(struct svc_xprt *xprt); | 117 | void svc_xprt_put(struct svc_xprt *xprt); |
| 119 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); | 118 | void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); |
| 120 | void svc_close_xprt(struct svc_xprt *xprt); | 119 | void svc_close_xprt(struct svc_xprt *xprt); |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 3e317307e288..295e6ed21ca0 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
| @@ -208,6 +208,26 @@ static struct svc_xprt *__svc_xpo_create(struct svc_xprt_class *xcl, | |||
| 208 | return xcl->xcl_ops->xpo_create(serv, net, sap, len, flags); | 208 | return xcl->xcl_ops->xpo_create(serv, net, sap, len, flags); |
| 209 | } | 209 | } |
| 210 | 210 | ||
| 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 | |||
| 211 | void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) | 231 | void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) |
| 212 | { | 232 | { |
| 213 | clear_bit(XPT_TEMP, &new->xpt_flags); | 233 | clear_bit(XPT_TEMP, &new->xpt_flags); |
| @@ -398,27 +418,6 @@ static struct svc_xprt *svc_xprt_dequeue(struct svc_pool *pool) | |||
| 398 | return xprt; | 418 | return xprt; |
| 399 | } | 419 | } |
| 400 | 420 | ||
| 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 | |||
| 422 | /** | 421 | /** |
| 423 | * svc_reserve - change the space reserved for the reply to a request. | 422 | * svc_reserve - change the space reserved for the reply to a request. |
| 424 | * @rqstp: The request in question | 423 | * @rqstp: The request in question |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 73b428bef598..62e4f9bcc387 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
| @@ -578,10 +578,6 @@ static void handle_connect_req(struct rdma_cm_id *new_cma_id, size_t client_ird) | |||
| 578 | list_add_tail(&newxprt->sc_accept_q, &listen_xprt->sc_accept_q); | 578 | list_add_tail(&newxprt->sc_accept_q, &listen_xprt->sc_accept_q); |
| 579 | spin_unlock_bh(&listen_xprt->sc_lock); | 579 | spin_unlock_bh(&listen_xprt->sc_lock); |
| 580 | 580 | ||
| 581 | /* | ||
| 582 | * Can't use svc_xprt_received here because we are not on a | ||
| 583 | * rqstp thread | ||
| 584 | */ | ||
| 585 | set_bit(XPT_CONN, &listen_xprt->sc_xprt.xpt_flags); | 581 | set_bit(XPT_CONN, &listen_xprt->sc_xprt.xpt_flags); |
| 586 | svc_xprt_enqueue(&listen_xprt->sc_xprt); | 582 | svc_xprt_enqueue(&listen_xprt->sc_xprt); |
| 587 | } | 583 | } |
