diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-09-27 01:29:38 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-28 21:01:21 -0400 |
commit | d8ed029d6000ba2e2908d9286409e4833c091b4c (patch) | |
tree | 732feaa2e3751df5c81032a30ff4761427492ac4 /include/linux | |
parent | 7699431301b189fca7ccbb64fe54e5a5170f8497 (diff) |
[SUNRPC]: trivial endianness annotations
pure s/u32/__be32/
[AV: large part based on Alexey's patches]
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/sunrpc/auth.h | 16 | ||||
-rw-r--r-- | include/linux/sunrpc/msg_prot.h | 2 | ||||
-rw-r--r-- | include/linux/sunrpc/svc.h | 14 | ||||
-rw-r--r-- | include/linux/sunrpc/svcauth.h | 4 | ||||
-rw-r--r-- | include/linux/sunrpc/xdr.h | 38 | ||||
-rw-r--r-- | include/linux/sunrpc/xprt.h | 12 |
6 files changed, 43 insertions, 43 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index a6de332e57d..862c0d8c838 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -109,13 +109,13 @@ struct rpc_credops { | |||
109 | void (*crdestroy)(struct rpc_cred *); | 109 | void (*crdestroy)(struct rpc_cred *); |
110 | 110 | ||
111 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 111 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
112 | u32 * (*crmarshal)(struct rpc_task *, u32 *); | 112 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
113 | int (*crrefresh)(struct rpc_task *); | 113 | int (*crrefresh)(struct rpc_task *); |
114 | u32 * (*crvalidate)(struct rpc_task *, u32 *); | 114 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
115 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, | 115 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, |
116 | void *, u32 *, void *); | 116 | void *, __be32 *, void *); |
117 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, | 117 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, |
118 | void *, u32 *, void *); | 118 | void *, __be32 *, void *); |
119 | }; | 119 | }; |
120 | 120 | ||
121 | extern struct rpc_authops authunix_ops; | 121 | extern struct rpc_authops authunix_ops; |
@@ -134,10 +134,10 @@ struct rpc_cred * rpcauth_bindcred(struct rpc_task *); | |||
134 | void rpcauth_holdcred(struct rpc_task *); | 134 | void rpcauth_holdcred(struct rpc_task *); |
135 | void put_rpccred(struct rpc_cred *); | 135 | void put_rpccred(struct rpc_cred *); |
136 | void rpcauth_unbindcred(struct rpc_task *); | 136 | void rpcauth_unbindcred(struct rpc_task *); |
137 | u32 * rpcauth_marshcred(struct rpc_task *, u32 *); | 137 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
138 | u32 * rpcauth_checkverf(struct rpc_task *, u32 *); | 138 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
139 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj); | 139 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); |
140 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj); | 140 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); |
141 | int rpcauth_refreshcred(struct rpc_task *); | 141 | int rpcauth_refreshcred(struct rpc_task *); |
142 | void rpcauth_invalcred(struct rpc_task *); | 142 | void rpcauth_invalcred(struct rpc_task *); |
143 | int rpcauth_uptodatecred(struct rpc_task *); | 143 | int rpcauth_uptodatecred(struct rpc_task *); |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index f43f237360a..d9f5934ac9f 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -95,7 +95,7 @@ enum rpc_auth_stat { | |||
95 | * 2GB. | 95 | * 2GB. |
96 | */ | 96 | */ |
97 | 97 | ||
98 | typedef u32 rpc_fraghdr; | 98 | typedef __be32 rpc_fraghdr; |
99 | 99 | ||
100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) | 100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) |
101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | 101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 5df1d319f5d..73140ee5c63 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -147,7 +147,7 @@ struct svc_rqst { | |||
147 | short rq_arghi; /* pages available in argument page list */ | 147 | short rq_arghi; /* pages available in argument page list */ |
148 | short rq_resused; /* pages used for result */ | 148 | short rq_resused; /* pages used for result */ |
149 | 149 | ||
150 | u32 rq_xid; /* transmission id */ | 150 | __be32 rq_xid; /* transmission id */ |
151 | u32 rq_prog; /* program number */ | 151 | u32 rq_prog; /* program number */ |
152 | u32 rq_vers; /* program version */ | 152 | u32 rq_vers; /* program version */ |
153 | u32 rq_proc; /* procedure number */ | 153 | u32 rq_proc; /* procedure number */ |
@@ -156,7 +156,7 @@ struct svc_rqst { | |||
156 | rq_secure : 1; /* secure port */ | 156 | rq_secure : 1; /* secure port */ |
157 | 157 | ||
158 | 158 | ||
159 | __u32 rq_daddr; /* dest addr of request - reply from here */ | 159 | __be32 rq_daddr; /* dest addr of request - reply from here */ |
160 | 160 | ||
161 | void * rq_argp; /* decoded arguments */ | 161 | void * rq_argp; /* decoded arguments */ |
162 | void * rq_resp; /* xdr'd results */ | 162 | void * rq_resp; /* xdr'd results */ |
@@ -186,7 +186,7 @@ struct svc_rqst { | |||
186 | * Check buffer bounds after decoding arguments | 186 | * Check buffer bounds after decoding arguments |
187 | */ | 187 | */ |
188 | static inline int | 188 | static inline int |
189 | xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | 189 | xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p) |
190 | { | 190 | { |
191 | char *cp = (char *)p; | 191 | char *cp = (char *)p; |
192 | struct kvec *vec = &rqstp->rq_arg.head[0]; | 192 | struct kvec *vec = &rqstp->rq_arg.head[0]; |
@@ -195,7 +195,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | |||
195 | } | 195 | } |
196 | 196 | ||
197 | static inline int | 197 | static inline int |
198 | xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | 198 | xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p) |
199 | { | 199 | { |
200 | struct kvec *vec = &rqstp->rq_res.head[0]; | 200 | struct kvec *vec = &rqstp->rq_res.head[0]; |
201 | char *cp = (char*)p; | 201 | char *cp = (char*)p; |
@@ -266,10 +266,10 @@ struct svc_deferred_req { | |||
266 | u32 prot; /* protocol (UDP or TCP) */ | 266 | u32 prot; /* protocol (UDP or TCP) */ |
267 | struct sockaddr_in addr; | 267 | struct sockaddr_in addr; |
268 | struct svc_sock *svsk; /* where reply must go */ | 268 | struct svc_sock *svsk; /* where reply must go */ |
269 | u32 daddr; /* where reply must come from */ | 269 | __be32 daddr; /* where reply must come from */ |
270 | struct cache_deferred_req handle; | 270 | struct cache_deferred_req handle; |
271 | int argslen; | 271 | int argslen; |
272 | u32 args[0]; | 272 | __be32 args[0]; |
273 | }; | 273 | }; |
274 | 274 | ||
275 | /* | 275 | /* |
@@ -301,7 +301,7 @@ struct svc_version { | |||
301 | * A return value of 0 means drop the request. | 301 | * A return value of 0 means drop the request. |
302 | * vs_dispatch == NULL means use default dispatcher. | 302 | * vs_dispatch == NULL means use default dispatcher. |
303 | */ | 303 | */ |
304 | int (*vs_dispatch)(struct svc_rqst *, u32 *); | 304 | int (*vs_dispatch)(struct svc_rqst *, __be32 *); |
305 | }; | 305 | }; |
306 | 306 | ||
307 | /* | 307 | /* |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index 2fe2087edd6..a6601650dee 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -95,7 +95,7 @@ struct auth_ops { | |||
95 | char * name; | 95 | char * name; |
96 | struct module *owner; | 96 | struct module *owner; |
97 | int flavour; | 97 | int flavour; |
98 | int (*accept)(struct svc_rqst *rq, u32 *authp); | 98 | int (*accept)(struct svc_rqst *rq, __be32 *authp); |
99 | int (*release)(struct svc_rqst *rq); | 99 | int (*release)(struct svc_rqst *rq); |
100 | void (*domain_release)(struct auth_domain *); | 100 | void (*domain_release)(struct auth_domain *); |
101 | int (*set_client)(struct svc_rqst *rq); | 101 | int (*set_client)(struct svc_rqst *rq); |
@@ -112,7 +112,7 @@ struct auth_ops { | |||
112 | #define SVC_COMPLETE 9 | 112 | #define SVC_COMPLETE 9 |
113 | 113 | ||
114 | 114 | ||
115 | extern int svc_authenticate(struct svc_rqst *rqstp, u32 *authp); | 115 | extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp); |
116 | extern int svc_authorise(struct svc_rqst *rqstp); | 116 | extern int svc_authorise(struct svc_rqst *rqstp); |
117 | extern int svc_set_client(struct svc_rqst *rqstp); | 117 | extern int svc_set_client(struct svc_rqst *rqstp); |
118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); | 118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index e6d3d349506..953723b09bc 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -32,7 +32,7 @@ struct xdr_netobj { | |||
32 | * side) or svc_rqst pointer (server side). | 32 | * side) or svc_rqst pointer (server side). |
33 | * Encode functions always assume there's enough room in the buffer. | 33 | * Encode functions always assume there's enough room in the buffer. |
34 | */ | 34 | */ |
35 | typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); | 35 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Basic structure for transmission/reception of a client XDR message. | 38 | * Basic structure for transmission/reception of a client XDR message. |
@@ -88,19 +88,19 @@ struct xdr_buf { | |||
88 | /* | 88 | /* |
89 | * Miscellaneous XDR helper functions | 89 | * Miscellaneous XDR helper functions |
90 | */ | 90 | */ |
91 | u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); | 91 | __be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len); |
92 | u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); | 92 | __be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len); |
93 | u32 * xdr_encode_string(u32 *p, const char *s); | 93 | __be32 *xdr_encode_string(__be32 *p, const char *s); |
94 | u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); | 94 | __be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen); |
95 | u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); | 95 | __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); |
96 | u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); | 96 | __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); |
97 | 97 | ||
98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, | 98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, |
99 | unsigned int); | 99 | unsigned int); |
100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, | 100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, |
101 | struct page **, unsigned int, unsigned int); | 101 | struct page **, unsigned int, unsigned int); |
102 | 102 | ||
103 | static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | 103 | static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) |
104 | { | 104 | { |
105 | return xdr_encode_opaque(p, s, len); | 105 | return xdr_encode_opaque(p, s, len); |
106 | } | 106 | } |
@@ -108,16 +108,16 @@ static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | |||
108 | /* | 108 | /* |
109 | * Decode 64bit quantities (NFSv3 support) | 109 | * Decode 64bit quantities (NFSv3 support) |
110 | */ | 110 | */ |
111 | static inline u32 * | 111 | static inline __be32 * |
112 | xdr_encode_hyper(u32 *p, __u64 val) | 112 | xdr_encode_hyper(__be32 *p, __u64 val) |
113 | { | 113 | { |
114 | *p++ = htonl(val >> 32); | 114 | *p++ = htonl(val >> 32); |
115 | *p++ = htonl(val & 0xFFFFFFFF); | 115 | *p++ = htonl(val & 0xFFFFFFFF); |
116 | return p; | 116 | return p; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline u32 * | 119 | static inline __be32 * |
120 | xdr_decode_hyper(u32 *p, __u64 *valp) | 120 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
121 | { | 121 | { |
122 | *valp = ((__u64) ntohl(*p++)) << 32; | 122 | *valp = ((__u64) ntohl(*p++)) << 32; |
123 | *valp |= ntohl(*p++); | 123 | *valp |= ntohl(*p++); |
@@ -128,7 +128,7 @@ xdr_decode_hyper(u32 *p, __u64 *valp) | |||
128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) | 128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) |
129 | */ | 129 | */ |
130 | static inline int | 130 | static inline int |
131 | xdr_adjust_iovec(struct kvec *iov, u32 *p) | 131 | xdr_adjust_iovec(struct kvec *iov, __be32 *p) |
132 | { | 132 | { |
133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); | 133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); |
134 | } | 134 | } |
@@ -180,19 +180,19 @@ extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | |||
180 | * Provide some simple tools for XDR buffer overflow-checking etc. | 180 | * Provide some simple tools for XDR buffer overflow-checking etc. |
181 | */ | 181 | */ |
182 | struct xdr_stream { | 182 | struct xdr_stream { |
183 | uint32_t *p; /* start of available buffer */ | 183 | __be32 *p; /* start of available buffer */ |
184 | struct xdr_buf *buf; /* XDR buffer to read/write */ | 184 | struct xdr_buf *buf; /* XDR buffer to read/write */ |
185 | 185 | ||
186 | uint32_t *end; /* end of available buffer space */ | 186 | __be32 *end; /* end of available buffer space */ |
187 | struct kvec *iov; /* pointer to the current kvec */ | 187 | struct kvec *iov; /* pointer to the current kvec */ |
188 | }; | 188 | }; |
189 | 189 | ||
190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
191 | extern uint32_t *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 191 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
193 | unsigned int base, unsigned int len); | 193 | unsigned int base, unsigned int len); |
194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
195 | extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 195 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
198 | 198 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index bdeba8538c7..6cf62658075 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -79,7 +79,7 @@ struct rpc_rqst { | |||
79 | * This is the private part | 79 | * This is the private part |
80 | */ | 80 | */ |
81 | struct rpc_task * rq_task; /* RPC task data */ | 81 | struct rpc_task * rq_task; /* RPC task data */ |
82 | __u32 rq_xid; /* request XID */ | 82 | __be32 rq_xid; /* request XID */ |
83 | int rq_cong; /* has incremented xprt->cong */ | 83 | int rq_cong; /* has incremented xprt->cong */ |
84 | int rq_received; /* receive completed */ | 84 | int rq_received; /* receive completed */ |
85 | u32 rq_seqno; /* gss seq no. used on req. */ | 85 | u32 rq_seqno; /* gss seq no. used on req. */ |
@@ -171,9 +171,9 @@ struct rpc_xprt { | |||
171 | /* | 171 | /* |
172 | * State of TCP reply receive stuff | 172 | * State of TCP reply receive stuff |
173 | */ | 173 | */ |
174 | u32 tcp_recm, /* Fragment header */ | 174 | __be32 tcp_recm, /* Fragment header */ |
175 | tcp_xid, /* Current XID */ | 175 | tcp_xid; /* Current XID */ |
176 | tcp_reclen, /* fragment length */ | 176 | u32 tcp_reclen, /* fragment length */ |
177 | tcp_offset; /* fragment offset */ | 177 | tcp_offset; /* fragment offset */ |
178 | unsigned long tcp_copied, /* copied to request */ | 178 | unsigned long tcp_copied, /* copied to request */ |
179 | tcp_flags; | 179 | tcp_flags; |
@@ -253,7 +253,7 @@ void xprt_release(struct rpc_task *task); | |||
253 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); | 253 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
254 | void xprt_put(struct rpc_xprt *xprt); | 254 | void xprt_put(struct rpc_xprt *xprt); |
255 | 255 | ||
256 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) | 256 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) |
257 | { | 257 | { |
258 | return p + xprt->tsh_size; | 258 | return p + xprt->tsh_size; |
259 | } | 259 | } |
@@ -268,7 +268,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task); | |||
268 | void xprt_write_space(struct rpc_xprt *xprt); | 268 | void xprt_write_space(struct rpc_xprt *xprt); |
269 | void xprt_update_rtt(struct rpc_task *task); | 269 | void xprt_update_rtt(struct rpc_task *task); |
270 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 270 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
271 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); | 271 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
272 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 272 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
273 | void xprt_release_rqst_cong(struct rpc_task *task); | 273 | void xprt_release_rqst_cong(struct rpc_task *task); |
274 | void xprt_disconnect(struct rpc_xprt *xprt); | 274 | void xprt_disconnect(struct rpc_xprt *xprt); |