aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/xdr.h
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2006-09-27 01:29:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-09-28 21:01:21 -0400
commitd8ed029d6000ba2e2908d9286409e4833c091b4c (patch)
tree732feaa2e3751df5c81032a30ff4761427492ac4 /include/linux/sunrpc/xdr.h
parent7699431301b189fca7ccbb64fe54e5a5170f8497 (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/sunrpc/xdr.h')
-rw-r--r--include/linux/sunrpc/xdr.h38
1 files changed, 19 insertions, 19 deletions
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index e6d3d349506c..953723b09bc6 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 */
35typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); 35typedef 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 */
91u32 * 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);
92u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); 92__be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len);
93u32 * xdr_encode_string(u32 *p, const char *s); 93__be32 *xdr_encode_string(__be32 *p, const char *s);
94u32 * 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);
95u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); 95__be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *);
96u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); 96__be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *);
97 97
98void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, 98void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int,
99 unsigned int); 99 unsigned int);
100void xdr_inline_pages(struct xdr_buf *, unsigned int, 100void xdr_inline_pages(struct xdr_buf *, unsigned int,
101 struct page **, unsigned int, unsigned int); 101 struct page **, unsigned int, unsigned int);
102 102
103static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) 103static 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 */
111static inline u32 * 111static inline __be32 *
112xdr_encode_hyper(u32 *p, __u64 val) 112xdr_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
119static inline u32 * 119static inline __be32 *
120xdr_decode_hyper(u32 *p, __u64 *valp) 120xdr_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 */
130static inline int 130static inline int
131xdr_adjust_iovec(struct kvec *iov, u32 *p) 131xdr_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 */
182struct xdr_stream { 182struct 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
190extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); 190extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
191extern uint32_t *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); 191extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes);
192extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, 192extern 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);
194extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); 194extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p);
195extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); 195extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes);
196extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); 196extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len);
197extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); 197extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len);
198 198