diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-08-09 15:09:43 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:09:43 -0400 |
commit | 0e47f0d665efcf1b45f293422d21d8383f07d122 (patch) | |
tree | ed0f1ba99b4698c80ad79d0cbb706cadfdb8b167 /net/sunrpc/rpcb_clnt.c | |
parent | c0c077df009f2f329875051ac5283df235288689 (diff) |
SUNRPC: Clean up: Remove unused XDR decoder functions from rpcb_clnt.c
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/rpcb_clnt.c')
-rw-r--r-- | net/sunrpc/rpcb_clnt.c | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index 88de754e3b02..c4b716cacf21 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -718,15 +718,6 @@ static int rpcb_enc_mapping(struct rpc_rqst *req, __be32 *p, | |||
718 | return 0; | 718 | return 0; |
719 | } | 719 | } |
720 | 720 | ||
721 | static int rpcb_decode_getport(struct rpc_rqst *req, __be32 *p, | ||
722 | unsigned short *portp) | ||
723 | { | ||
724 | *portp = (unsigned short) ntohl(*p++); | ||
725 | dprintk("RPC: rpcb getport result: %u\n", | ||
726 | *portp); | ||
727 | return 0; | ||
728 | } | ||
729 | |||
730 | static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p, | 721 | static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p, |
731 | struct rpcbind_args *rpcb) | 722 | struct rpcbind_args *rpcb) |
732 | { | 723 | { |
@@ -752,15 +743,6 @@ static int rpcb_dec_getport(struct rpc_rqst *req, __be32 *p, | |||
752 | return 0; | 743 | return 0; |
753 | } | 744 | } |
754 | 745 | ||
755 | static int rpcb_decode_set(struct rpc_rqst *req, __be32 *p, | ||
756 | unsigned int *boolp) | ||
757 | { | ||
758 | *boolp = (unsigned int) ntohl(*p++); | ||
759 | dprintk("RPC: rpcb set/unset call %s\n", | ||
760 | (*boolp ? "succeeded" : "failed")); | ||
761 | return 0; | ||
762 | } | ||
763 | |||
764 | static int rpcb_dec_set(struct rpc_rqst *req, __be32 *p, | 746 | static int rpcb_dec_set(struct rpc_rqst *req, __be32 *p, |
765 | unsigned int *boolp) | 747 | unsigned int *boolp) |
766 | { | 748 | { |
@@ -833,69 +815,6 @@ static int rpcb_enc_getaddr(struct rpc_rqst *req, __be32 *p, | |||
833 | return 0; | 815 | return 0; |
834 | } | 816 | } |
835 | 817 | ||
836 | static int rpcb_decode_getaddr(struct rpc_rqst *req, __be32 *p, | ||
837 | unsigned short *portp) | ||
838 | { | ||
839 | char *addr; | ||
840 | u32 addr_len; | ||
841 | int c, i, f, first, val; | ||
842 | |||
843 | *portp = 0; | ||
844 | addr_len = ntohl(*p++); | ||
845 | |||
846 | if (addr_len == 0) { | ||
847 | dprintk("RPC: rpcb_decode_getaddr: " | ||
848 | "service is not registered\n"); | ||
849 | return 0; | ||
850 | } | ||
851 | |||
852 | /* | ||
853 | * Simple sanity check. | ||
854 | */ | ||
855 | if (addr_len > RPCBIND_MAXUADDRLEN) | ||
856 | goto out_err; | ||
857 | |||
858 | /* | ||
859 | * Start at the end and walk backwards until the first dot | ||
860 | * is encountered. When the second dot is found, we have | ||
861 | * both parts of the port number. | ||
862 | */ | ||
863 | addr = (char *)p; | ||
864 | val = 0; | ||
865 | first = 1; | ||
866 | f = 1; | ||
867 | for (i = addr_len - 1; i > 0; i--) { | ||
868 | c = addr[i]; | ||
869 | if (c >= '0' && c <= '9') { | ||
870 | val += (c - '0') * f; | ||
871 | f *= 10; | ||
872 | } else if (c == '.') { | ||
873 | if (first) { | ||
874 | *portp = val; | ||
875 | val = first = 0; | ||
876 | f = 1; | ||
877 | } else { | ||
878 | *portp |= (val << 8); | ||
879 | break; | ||
880 | } | ||
881 | } | ||
882 | } | ||
883 | |||
884 | /* | ||
885 | * Simple sanity check. If we never saw a dot in the reply, | ||
886 | * then this was probably just garbage. | ||
887 | */ | ||
888 | if (first) | ||
889 | goto out_err; | ||
890 | |||
891 | dprintk("RPC: rpcb_decode_getaddr port=%u\n", *portp); | ||
892 | return 0; | ||
893 | |||
894 | out_err: | ||
895 | dprintk("RPC: rpcbind server returned malformed reply\n"); | ||
896 | return -EIO; | ||
897 | } | ||
898 | |||
899 | static int rpcb_dec_getaddr(struct rpc_rqst *req, __be32 *p, | 818 | static int rpcb_dec_getaddr(struct rpc_rqst *req, __be32 *p, |
900 | struct rpcbind_args *rpcb) | 819 | struct rpcbind_args *rpcb) |
901 | { | 820 | { |