Skip to content

Commit db820d6

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
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>
1 parent f6fb3f6 commit db820d6

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

‎net/sunrpc/rpcb_clnt.c‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,8 @@ static int rpcb_register_call(struct sockaddr *addr, size_t addrlen,
197197
return error;
198198
}
199199

200-
if (!result) {
201-
dprintk("RPC: registration failed\n");
200+
if (!result)
202201
return -EACCES;
203-
}
204-
205-
dprintk("RPC: registration succeeded\n");
206202
return 0;
207203
}
208204

@@ -628,7 +624,7 @@ static void rpcb_getport_done(struct rpc_task *child, void *data)
628624
static int rpcb_encode_mapping(struct rpc_rqst *req, __be32 *p,
629625
struct rpcbind_args *rpcb)
630626
{
631-
dprintk("RPC: rpcb_encode_mapping(%u, %u, %d, %u)\n",
627+
dprintk("RPC: encoding rpcb request (%u, %u, %d, %u)\n",
632628
rpcb->r_prog, rpcb->r_vers, rpcb->r_prot, rpcb->r_port);
633629
*p++ = htonl(rpcb->r_prog);
634630
*p++ = htonl(rpcb->r_vers);
@@ -643,7 +639,7 @@ static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p,
643639
unsigned short *portp)
644640
{
645641
*portp = (unsigned short) ntohl(*p++);
646-
dprintk("RPC: rpcb_decode_getport result %u\n",
642+
dprintk("RPC: rpcb getport result: %u\n",
647643
*portp);
648644
return 0;
649645
}
@@ -652,15 +648,15 @@ static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p,
652648
unsigned int *boolp)
653649
{
654650
*boolp = (unsigned int) ntohl(*p++);
655-
dprintk("RPC: rpcb_decode_set: call %s\n",
651+
dprintk("RPC: rpcb set/unset call %s\n",
656652
(*boolp ? "succeeded" : "failed"));
657653
return 0;
658654
}
659655

660656
static int rpcb_encode_getaddr(struct rpc_rqst *req, __be32 *p,
661657
struct rpcbind_args *rpcb)
662658
{
663-
dprintk("RPC: rpcb_encode_getaddr(%u, %u, %s)\n",
659+
dprintk("RPC: encoding rpcb request (%u, %u, %s)\n",
664660
rpcb->r_prog, rpcb->r_vers, rpcb->r_addr);
665661
*p++ = htonl(rpcb->r_prog);
666662
*p++ = htonl(rpcb->r_vers);

0 commit comments

Comments
 (0)