]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
SUNRPC: Clean up: Remove unused XDR decoder functions from rpcb_clnt.c
authorChuck Lever <chuck.lever@oracle.com>
Sun, 9 Aug 2009 19:09:43 +0000 (15:09 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 9 Aug 2009 19:09:43 +0000 (15:09 -0400)
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/rpcb_clnt.c

index 88de754e3b0275ff30f2610ac2b334f37a84df9f..c4b716cacf2143ab5c80b5a75d24770ec28ff3e6 100644 (file)
@@ -718,15 +718,6 @@ static int rpcb_enc_mapping(struct rpc_rqst *req, __be32 *p,
        return 0;
 }
 
-static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p,
-                              unsigned short *portp)
-{
-       *portp = (unsigned short) ntohl(*p++);
-       dprintk("RPC:       rpcb getport result: %u\n",
-                       *portp);
-       return 0;
-}
-
 static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p,
                            struct rpcbind_args *rpcb)
 {
@@ -752,15 +743,6 @@ static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p,
        return 0;
 }
 
-static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p,
-                          unsigned int *boolp)
-{
-       *boolp = (unsigned int) ntohl(*p++);
-       dprintk("RPC:       rpcb set/unset call %s\n",
-                       (*boolp ? "succeeded" : "failed"));
-       return 0;
-}
-
 static int rpcb_dec_set(struct rpc_rqst *req, __be32 *p,
                        unsigned int *boolp)
 {
@@ -833,69 +815,6 @@ static int rpcb_enc_getaddr(struct rpc_rqst *req, __be32 *p,
        return 0;
 }
 
-static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p,
-                              unsigned short *portp)
-{
-       char *addr;
-       u32 addr_len;
-       int c, i, f, first, val;
-
-       *portp = 0;
-       addr_len = ntohl(*p++);
-
-       if (addr_len == 0) {
-               dprintk("RPC:       rpcb_decode_getaddr: "
-                                       "service is not registered\n");
-               return 0;
-       }
-
-       /*
-        * Simple sanity check.
-        */
-       if (addr_len > RPCBIND_MAXUADDRLEN)
-               goto out_err;
-
-       /*
-        * Start at the end and walk backwards until the first dot
-        * is encountered.  When the second dot is found, we have
-        * both parts of the port number.
-        */
-       addr = (char *)p;
-       val = 0;
-       first = 1;
-       f = 1;
-       for (i = addr_len - 1; i > 0; i--) {
-               c = addr[i];
-               if (c >= '0' && c <= '9') {
-                       val += (c - '0') * f;
-                       f *= 10;
-               } else if (c == '.') {
-                       if (first) {
-                               *portp = val;
-                               val = first = 0;
-                               f = 1;
-                       } else {
-                               *portp |= (val << 8);
-                               break;
-                       }
-               }
-       }
-
-       /*
-        * Simple sanity check.  If we never saw a dot in the reply,
-        * then this was probably just garbage.
-        */
-       if (first)
-               goto out_err;
-
-       dprintk("RPC:       rpcb_decode_getaddr port=%u\n", *portp);
-       return 0;
-
-out_err:
-       dprintk("RPC:       rpcbind server returned malformed reply\n");
-       return -EIO;
-}
-
 static int rpcb_dec_getaddr(struct rpc_rqst *req, __be32 *p,
                            struct rpcbind_args *rpcb)
 {