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

Configure Feed

Select the types of activity you want to include in your feed.

sunrpc: Kill RPC_IFDEBUG()

RPC_IFDEBUG() is used in only two places. In one the user of
the definition is guarded by ifdeffery, in the second one
it's implied due to dprintk() usage. Kill the macro and move
the ifdeffery to the regular condition with the variable defined
inside, while in the second case add the same conditional and
move the respective code there.

Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>

authored by

Andy Shevchenko and committed by
Chuck Lever
adcc5911 f83c8dda

+20 -18
+6 -3
fs/nfsd/nfsfh.c
··· 105 105 { 106 106 /* Check if the request originated from a secure port. */ 107 107 if (rqstp && !nfsd_originating_port_ok(rqstp, cred, exp)) { 108 - RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]); 109 - dprintk("nfsd: request from insecure port %s!\n", 110 - svc_print_addr(rqstp, buf, sizeof(buf))); 108 + if (IS_ENABLED(CONFIG_SUNRPC_DEBUG)) { 109 + char buf[RPC_MAX_ADDRBUFLEN]; 110 + 111 + dprintk("nfsd: request from insecure port %s!\n", 112 + svc_print_addr(rqstp, buf, sizeof(buf))); 113 + } 111 114 return nfserr_perm; 112 115 } 113 116
-2
include/linux/sunrpc/debug.h
··· 49 49 } \ 50 50 } while (0) 51 51 52 - # define RPC_IFDEBUG(x) x 53 52 #else 54 53 # define ifdebug(fac) if (0) 55 54 # define dfprintk(fac, fmt, ...) do {} while (0) 56 55 # define dfprintk_rcu(fac, fmt, ...) do {} while (0) 57 - # define RPC_IFDEBUG(x) 58 56 #endif 59 57 60 58 /*
+14 -13
net/sunrpc/xprtrdma/svc_rdma_transport.c
··· 414 414 struct ib_qp_init_attr qp_attr; 415 415 struct ib_device *dev; 416 416 int ret = 0; 417 - RPC_IFDEBUG(struct sockaddr *sap); 418 417 419 418 listen_rdma = container_of(xprt, struct svcxprt_rdma, sc_xprt); 420 419 clear_bit(XPT_CONN, &xprt->xpt_flags); ··· 559 560 goto errout; 560 561 } 561 562 562 - #if IS_ENABLED(CONFIG_SUNRPC_DEBUG) 563 - dprintk("svcrdma: new connection accepted on device %s:\n", dev->name); 564 - sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr; 565 - dprintk(" local address : %pIS:%u\n", sap, rpc_get_port(sap)); 566 - sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; 567 - dprintk(" remote address : %pIS:%u\n", sap, rpc_get_port(sap)); 568 - dprintk(" max_sge : %d\n", newxprt->sc_max_send_sges); 569 - dprintk(" sq_depth : %d\n", newxprt->sc_sq_depth); 570 - dprintk(" rdma_rw_ctxs : %d\n", ctxts); 571 - dprintk(" max_requests : %d\n", newxprt->sc_max_requests); 572 - dprintk(" ord : %d\n", conn_param.initiator_depth); 573 - #endif 563 + if (IS_ENABLED(CONFIG_SUNRPC_DEBUG)) { 564 + struct sockaddr *sap; 565 + 566 + dprintk("svcrdma: new connection accepted on device %s:\n", dev->name); 567 + sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.src_addr; 568 + dprintk(" local address : %pIS:%u\n", sap, rpc_get_port(sap)); 569 + sap = (struct sockaddr *)&newxprt->sc_cm_id->route.addr.dst_addr; 570 + dprintk(" remote address : %pIS:%u\n", sap, rpc_get_port(sap)); 571 + dprintk(" max_sge : %d\n", newxprt->sc_max_send_sges); 572 + dprintk(" sq_depth : %d\n", newxprt->sc_sq_depth); 573 + dprintk(" rdma_rw_ctxs : %d\n", ctxts); 574 + dprintk(" max_requests : %d\n", newxprt->sc_max_requests); 575 + dprintk(" ord : %d\n", conn_param.initiator_depth); 576 + } 574 577 575 578 return &newxprt->sc_xprt; 576 579