diff options
Diffstat (limited to 'include/linux/sunrpc/svc.h')
-rw-r--r-- | include/linux/sunrpc/svc.h | 45 |
1 files changed, 31 insertions, 14 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 7b27c09b5604..73140ee5c638 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -78,28 +78,45 @@ struct svc_serv { | |||
78 | */ | 78 | */ |
79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) | 79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) |
80 | 80 | ||
81 | static inline u32 svc_getu32(struct kvec *iov) | 81 | static inline u32 svc_getnl(struct kvec *iov) |
82 | { | 82 | { |
83 | u32 val, *vp; | 83 | __be32 val, *vp; |
84 | vp = iov->iov_base; | 84 | vp = iov->iov_base; |
85 | val = *vp++; | 85 | val = *vp++; |
86 | iov->iov_base = (void*)vp; | 86 | iov->iov_base = (void*)vp; |
87 | iov->iov_len -= sizeof(u32); | 87 | iov->iov_len -= sizeof(__be32); |
88 | return ntohl(val); | ||
89 | } | ||
90 | |||
91 | static inline void svc_putnl(struct kvec *iov, u32 val) | ||
92 | { | ||
93 | __be32 *vp = iov->iov_base + iov->iov_len; | ||
94 | *vp = htonl(val); | ||
95 | iov->iov_len += sizeof(__be32); | ||
96 | } | ||
97 | |||
98 | static inline __be32 svc_getu32(struct kvec *iov) | ||
99 | { | ||
100 | __be32 val, *vp; | ||
101 | vp = iov->iov_base; | ||
102 | val = *vp++; | ||
103 | iov->iov_base = (void*)vp; | ||
104 | iov->iov_len -= sizeof(__be32); | ||
88 | return val; | 105 | return val; |
89 | } | 106 | } |
90 | 107 | ||
91 | static inline void svc_ungetu32(struct kvec *iov) | 108 | static inline void svc_ungetu32(struct kvec *iov) |
92 | { | 109 | { |
93 | u32 *vp = (u32 *)iov->iov_base; | 110 | __be32 *vp = (__be32 *)iov->iov_base; |
94 | iov->iov_base = (void *)(vp - 1); | 111 | iov->iov_base = (void *)(vp - 1); |
95 | iov->iov_len += sizeof(*vp); | 112 | iov->iov_len += sizeof(*vp); |
96 | } | 113 | } |
97 | 114 | ||
98 | static inline void svc_putu32(struct kvec *iov, u32 val) | 115 | static inline void svc_putu32(struct kvec *iov, __be32 val) |
99 | { | 116 | { |
100 | u32 *vp = iov->iov_base + iov->iov_len; | 117 | __be32 *vp = iov->iov_base + iov->iov_len; |
101 | *vp = val; | 118 | *vp = val; |
102 | iov->iov_len += sizeof(u32); | 119 | iov->iov_len += sizeof(__be32); |
103 | } | 120 | } |
104 | 121 | ||
105 | 122 | ||
@@ -130,7 +147,7 @@ struct svc_rqst { | |||
130 | short rq_arghi; /* pages available in argument page list */ | 147 | short rq_arghi; /* pages available in argument page list */ |
131 | short rq_resused; /* pages used for result */ | 148 | short rq_resused; /* pages used for result */ |
132 | 149 | ||
133 | u32 rq_xid; /* transmission id */ | 150 | __be32 rq_xid; /* transmission id */ |
134 | u32 rq_prog; /* program number */ | 151 | u32 rq_prog; /* program number */ |
135 | u32 rq_vers; /* program version */ | 152 | u32 rq_vers; /* program version */ |
136 | u32 rq_proc; /* procedure number */ | 153 | u32 rq_proc; /* procedure number */ |
@@ -139,7 +156,7 @@ struct svc_rqst { | |||
139 | rq_secure : 1; /* secure port */ | 156 | rq_secure : 1; /* secure port */ |
140 | 157 | ||
141 | 158 | ||
142 | __u32 rq_daddr; /* dest addr of request - reply from here */ | 159 | __be32 rq_daddr; /* dest addr of request - reply from here */ |
143 | 160 | ||
144 | void * rq_argp; /* decoded arguments */ | 161 | void * rq_argp; /* decoded arguments */ |
145 | void * rq_resp; /* xdr'd results */ | 162 | void * rq_resp; /* xdr'd results */ |
@@ -169,7 +186,7 @@ struct svc_rqst { | |||
169 | * Check buffer bounds after decoding arguments | 186 | * Check buffer bounds after decoding arguments |
170 | */ | 187 | */ |
171 | static inline int | 188 | static inline int |
172 | xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | 189 | xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p) |
173 | { | 190 | { |
174 | char *cp = (char *)p; | 191 | char *cp = (char *)p; |
175 | struct kvec *vec = &rqstp->rq_arg.head[0]; | 192 | struct kvec *vec = &rqstp->rq_arg.head[0]; |
@@ -178,7 +195,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | |||
178 | } | 195 | } |
179 | 196 | ||
180 | static inline int | 197 | static inline int |
181 | xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | 198 | xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p) |
182 | { | 199 | { |
183 | struct kvec *vec = &rqstp->rq_res.head[0]; | 200 | struct kvec *vec = &rqstp->rq_res.head[0]; |
184 | char *cp = (char*)p; | 201 | char *cp = (char*)p; |
@@ -249,10 +266,10 @@ struct svc_deferred_req { | |||
249 | u32 prot; /* protocol (UDP or TCP) */ | 266 | u32 prot; /* protocol (UDP or TCP) */ |
250 | struct sockaddr_in addr; | 267 | struct sockaddr_in addr; |
251 | struct svc_sock *svsk; /* where reply must go */ | 268 | struct svc_sock *svsk; /* where reply must go */ |
252 | u32 daddr; /* where reply must come from */ | 269 | __be32 daddr; /* where reply must come from */ |
253 | struct cache_deferred_req handle; | 270 | struct cache_deferred_req handle; |
254 | int argslen; | 271 | int argslen; |
255 | u32 args[0]; | 272 | __be32 args[0]; |
256 | }; | 273 | }; |
257 | 274 | ||
258 | /* | 275 | /* |
@@ -284,7 +301,7 @@ struct svc_version { | |||
284 | * A return value of 0 means drop the request. | 301 | * A return value of 0 means drop the request. |
285 | * vs_dispatch == NULL means use default dispatcher. | 302 | * vs_dispatch == NULL means use default dispatcher. |
286 | */ | 303 | */ |
287 | int (*vs_dispatch)(struct svc_rqst *, u32 *); | 304 | int (*vs_dispatch)(struct svc_rqst *, __be32 *); |
288 | }; | 305 | }; |
289 | 306 | ||
290 | /* | 307 | /* |