diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-08-09 15:09:33 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2009-08-09 15:09:33 -0400 |
commit | 0b10bf5e14d856d1d27a2117d07af2bebee81b75 (patch) | |
tree | a44943150a904c48aca28c9f7d054f0c8538fa71 /net/sunrpc/rpcb_clnt.c | |
parent | 169026a61e6f436dfc12c9d10d95455c4e9f945b (diff) |
SUNRPC: Move XDR data type size macros
Clean up: To make subsequent patches cleaner, move the XDR data type
size macros to the top of the file (similar to nfs4xdr.c) first.
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 | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c index beee6da33035..ad1d7315c498 100644 --- a/net/sunrpc/rpcb_clnt.c +++ b/net/sunrpc/rpcb_clnt.c | |||
@@ -75,6 +75,37 @@ enum { | |||
75 | #define RPCB_OWNER_STRING "0" | 75 | #define RPCB_OWNER_STRING "0" |
76 | #define RPCB_MAXOWNERLEN sizeof(RPCB_OWNER_STRING) | 76 | #define RPCB_MAXOWNERLEN sizeof(RPCB_OWNER_STRING) |
77 | 77 | ||
78 | /* | ||
79 | * XDR data type sizes | ||
80 | */ | ||
81 | #define RPCB_program_sz (1) | ||
82 | #define RPCB_version_sz (1) | ||
83 | #define RPCB_protocol_sz (1) | ||
84 | #define RPCB_port_sz (1) | ||
85 | #define RPCB_boolean_sz (1) | ||
86 | |||
87 | #define RPCB_netid_sz (1 + XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) | ||
88 | #define RPCB_addr_sz (1 + XDR_QUADLEN(RPCBIND_MAXUADDRLEN)) | ||
89 | #define RPCB_ownerstring_sz (1 + XDR_QUADLEN(RPCB_MAXOWNERLEN)) | ||
90 | |||
91 | /* | ||
92 | * XDR argument and result sizes | ||
93 | */ | ||
94 | #define RPCB_mappingargs_sz (RPCB_program_sz + RPCB_version_sz + \ | ||
95 | RPCB_protocol_sz + RPCB_port_sz) | ||
96 | #define RPCB_getaddrargs_sz (RPCB_program_sz + RPCB_version_sz + \ | ||
97 | RPCB_netid_sz + RPCB_addr_sz + \ | ||
98 | RPCB_ownerstring_sz) | ||
99 | |||
100 | #define RPCB_getportres_sz RPCB_port_sz | ||
101 | #define RPCB_setres_sz RPCB_boolean_sz | ||
102 | |||
103 | /* | ||
104 | * Note that RFC 1833 does not put any size restrictions on the | ||
105 | * address string returned by the remote rpcbind database. | ||
106 | */ | ||
107 | #define RPCB_getaddrres_sz RPCB_addr_sz | ||
108 | |||
78 | static void rpcb_getport_done(struct rpc_task *, void *); | 109 | static void rpcb_getport_done(struct rpc_task *, void *); |
79 | static void rpcb_map_release(void *data); | 110 | static void rpcb_map_release(void *data); |
80 | static struct rpc_program rpcb_program; | 111 | static struct rpc_program rpcb_program; |
@@ -768,31 +799,6 @@ out_err: | |||
768 | return -EIO; | 799 | return -EIO; |
769 | } | 800 | } |
770 | 801 | ||
771 | #define RPCB_program_sz (1u) | ||
772 | #define RPCB_version_sz (1u) | ||
773 | #define RPCB_protocol_sz (1u) | ||
774 | #define RPCB_port_sz (1u) | ||
775 | #define RPCB_boolean_sz (1u) | ||
776 | |||
777 | #define RPCB_netid_sz (1+XDR_QUADLEN(RPCBIND_MAXNETIDLEN)) | ||
778 | #define RPCB_addr_sz (1+XDR_QUADLEN(RPCBIND_MAXUADDRLEN)) | ||
779 | #define RPCB_ownerstring_sz (1+XDR_QUADLEN(RPCB_MAXOWNERLEN)) | ||
780 | |||
781 | #define RPCB_mappingargs_sz RPCB_program_sz+RPCB_version_sz+ \ | ||
782 | RPCB_protocol_sz+RPCB_port_sz | ||
783 | #define RPCB_getaddrargs_sz RPCB_program_sz+RPCB_version_sz+ \ | ||
784 | RPCB_netid_sz+RPCB_addr_sz+ \ | ||
785 | RPCB_ownerstring_sz | ||
786 | |||
787 | #define RPCB_setres_sz RPCB_boolean_sz | ||
788 | #define RPCB_getportres_sz RPCB_port_sz | ||
789 | |||
790 | /* | ||
791 | * Note that RFC 1833 does not put any size restrictions on the | ||
792 | * address string returned by the remote rpcbind database. | ||
793 | */ | ||
794 | #define RPCB_getaddrres_sz RPCB_addr_sz | ||
795 | |||
796 | #define PROC(proc, argtype, restype) \ | 802 | #define PROC(proc, argtype, restype) \ |
797 | [RPCBPROC_##proc] = { \ | 803 | [RPCBPROC_##proc] = { \ |
798 | .p_proc = RPCBPROC_##proc, \ | 804 | .p_proc = RPCBPROC_##proc, \ |