Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+20 -26
-1
include/linux/sunrpc/svc_xprt.h
··· 114 114 int svc_create_xprt(struct svc_serv *, const char *, struct net *, 115 115 const int, const unsigned short, int); 116 116 void svc_xprt_enqueue(struct svc_xprt *xprt); 117 - void svc_xprt_received(struct svc_xprt *); 118 117 void svc_xprt_put(struct svc_xprt *xprt); 119 118 void svc_xprt_copy_addrs(struct svc_rqst *rqstp, struct svc_xprt *xprt); 120 119 void svc_close_xprt(struct svc_xprt *xprt);
+20 -21
net/sunrpc/svc_xprt.c
··· 208 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 231 void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) 212 232 { 213 233 clear_bit(XPT_TEMP, &new->xpt_flags); ··· 417 397 418 398 return xprt; 419 399 } 420 - 421 - /* 422 - * svc_xprt_received conditionally queues the transport for processing 423 - * by another thread. The caller must hold the XPT_BUSY bit and must 424 - * not thereafter touch transport data. 425 - * 426 - * Note: XPT_DATA only gets cleared when a read-attempt finds no (or 427 - * insufficient) data. 428 - */ 429 - void svc_xprt_received(struct svc_xprt *xprt) 430 - { 431 - BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); 432 - /* As soon as we clear busy, the xprt could be closed and 433 - * 'put', so we need a reference to call svc_xprt_enqueue with: 434 - */ 435 - svc_xprt_get(xprt); 436 - clear_bit(XPT_BUSY, &xprt->xpt_flags); 437 - svc_xprt_enqueue(xprt); 438 - svc_xprt_put(xprt); 439 - } 440 - EXPORT_SYMBOL_GPL(svc_xprt_received); 441 400 442 401 /** 443 402 * svc_reserve - change the space reserved for the reply to a request.
-4
net/sunrpc/xprtrdma/svc_rdma_transport.c
··· 578 578 list_add_tail(&newxprt->sc_accept_q, &listen_xprt->sc_accept_q); 579 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 581 set_bit(XPT_CONN, &listen_xprt->sc_xprt.xpt_flags); 586 582 svc_xprt_enqueue(&listen_xprt->sc_xprt); 587 583 }