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

SUNRPC: Clean up debug messages in rpcb_clnt.c

The RPCB XDR functions are used for multiple procedures. For instance,
rpcb_encode_getaddr() is used for RPCB_GETADDR, RPCB_SET, and
RPCB_UNSET. Make the XDR debug messages more generic so they are less
confusing.

And, unlike in other RPC consumers in the kernel, a single debug flag
enables all levels of debug messages in the RPC bind client, including
XDR debug messages. Since the XDR decoders already report success or
failure in this case, remove redundant debug messages in the mid-level
rpcb_register_call() function.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>

authored by

Chuck Lever and committed by
J. Bruce Fields
db820d63 f6fb3f6f

+5 -9
+5 -9
net/sunrpc/rpcb_clnt.c
··· 197 197 return error; 198 198 } 199 199 200 - if (!result) { 201 - dprintk("RPC: registration failed\n"); 200 + if (!result) 202 201 return -EACCES; 203 - } 204 - 205 - dprintk("RPC: registration succeeded\n"); 206 202 return 0; 207 203 } 208 204 ··· 624 628 static int rpcb_encode_mapping(struct rpc_rqst *req, __be32 *p, 625 629 struct rpcbind_args *rpcb) 626 630 { 627 - dprintk("RPC: rpcb_encode_mapping(%u, %u, %d, %u)\n", 631 + dprintk("RPC: encoding rpcb request (%u, %u, %d, %u)\n", 628 632 rpcb->r_prog, rpcb->r_vers, rpcb->r_prot, rpcb->r_port); 629 633 *p++ = htonl(rpcb->r_prog); 630 634 *p++ = htonl(rpcb->r_vers); ··· 639 643 unsigned short *portp) 640 644 { 641 645 *portp = (unsigned short) ntohl(*p++); 642 - dprintk("RPC: rpcb_decode_getport result %u\n", 646 + dprintk("RPC: rpcb getport result: %u\n", 643 647 *portp); 644 648 return 0; 645 649 } ··· 648 652 unsigned int *boolp) 649 653 { 650 654 *boolp = (unsigned int) ntohl(*p++); 651 - dprintk("RPC: rpcb_decode_set: call %s\n", 655 + dprintk("RPC: rpcb set/unset call %s\n", 652 656 (*boolp ? "succeeded" : "failed")); 653 657 return 0; 654 658 } ··· 656 660 static int rpcb_encode_getaddr(struct rpc_rqst *req, __be32 *p, 657 661 struct rpcbind_args *rpcb) 658 662 { 659 - dprintk("RPC: rpcb_encode_getaddr(%u, %u, %s)\n", 663 + dprintk("RPC: encoding rpcb request (%u, %u, %s)\n", 660 664 rpcb->r_prog, rpcb->r_vers, rpcb->r_addr); 661 665 *p++ = htonl(rpcb->r_prog); 662 666 *p++ = htonl(rpcb->r_vers);