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

SUNRPC: Export svc_xprt_received()

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>

+11 -4
+1
include/linux/sunrpc/svc_xprt.h
··· 130 130 int svc_create_xprt(struct svc_serv *, const char *, struct net *, 131 131 const int, const unsigned short, int, 132 132 const struct cred *); 133 + void svc_xprt_received(struct svc_xprt *xprt); 133 134 void svc_xprt_do_enqueue(struct svc_xprt *xprt); 134 135 void svc_xprt_enqueue(struct svc_xprt *xprt); 135 136 void svc_xprt_put(struct svc_xprt *xprt);
+1
include/trace/events/sunrpc.h
··· 1781 1781 ), \ 1782 1782 TP_ARGS(xprt)) 1783 1783 1784 + DEFINE_SVC_XPRT_EVENT(received); 1784 1785 DEFINE_SVC_XPRT_EVENT(no_write_space); 1785 1786 DEFINE_SVC_XPRT_EVENT(close); 1786 1787 DEFINE_SVC_XPRT_EVENT(detach);
+9 -4
net/sunrpc/svc_xprt.c
··· 247 247 return xprt; 248 248 } 249 249 250 - /* 251 - * svc_xprt_received conditionally queues the transport for processing 252 - * by another thread. The caller must hold the XPT_BUSY bit and must 250 + /** 251 + * svc_xprt_received - start next receiver thread 252 + * @xprt: controlling transport 253 + * 254 + * The caller must hold the XPT_BUSY bit and must 253 255 * not thereafter touch transport data. 254 256 * 255 257 * Note: XPT_DATA only gets cleared when a read-attempt finds no (or 256 258 * insufficient) data. 257 259 */ 258 - static void svc_xprt_received(struct svc_xprt *xprt) 260 + void svc_xprt_received(struct svc_xprt *xprt) 259 261 { 260 262 if (!test_bit(XPT_BUSY, &xprt->xpt_flags)) { 261 263 WARN_ONCE(1, "xprt=0x%p already busy!", xprt); 262 264 return; 263 265 } 266 + 267 + trace_svc_xprt_received(xprt); 264 268 265 269 /* As soon as we clear busy, the xprt could be closed and 266 270 * 'put', so we need a reference to call svc_enqueue_xprt with: ··· 275 271 xprt->xpt_server->sv_ops->svo_enqueue_xprt(xprt); 276 272 svc_xprt_put(xprt); 277 273 } 274 + EXPORT_SYMBOL_GPL(svc_xprt_received); 278 275 279 276 void svc_add_new_perm_xprt(struct svc_serv *serv, struct svc_xprt *new) 280 277 {