aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/sunrpc/svc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/sunrpc/svc.h')
-rw-r--r--include/linux/sunrpc/svc.h49
1 files changed, 34 insertions, 15 deletions
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 503564384545..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
81static inline u32 svc_getu32(struct kvec *iov) 81static 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
91static 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
98static 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
91static inline void svc_ungetu32(struct kvec *iov) 108static 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
98static inline void svc_putu32(struct kvec *iov, u32 val) 115static 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 */
@@ -159,7 +176,9 @@ struct svc_rqst {
159 * determine what device number 176 * determine what device number
160 * to report (real or virtual) 177 * to report (real or virtual)
161 */ 178 */
162 179 int rq_sendfile_ok; /* turned off in gss privacy
180 * to prevent encrypting page
181 * cache pages */
163 wait_queue_head_t rq_wait; /* synchronization */ 182 wait_queue_head_t rq_wait; /* synchronization */
164}; 183};
165 184
@@ -167,7 +186,7 @@ struct svc_rqst {
167 * Check buffer bounds after decoding arguments 186 * Check buffer bounds after decoding arguments
168 */ 187 */
169static inline int 188static inline int
170xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) 189xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p)
171{ 190{
172 char *cp = (char *)p; 191 char *cp = (char *)p;
173 struct kvec *vec = &rqstp->rq_arg.head[0]; 192 struct kvec *vec = &rqstp->rq_arg.head[0];
@@ -176,7 +195,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p)
176} 195}
177 196
178static inline int 197static inline int
179xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) 198xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p)
180{ 199{
181 struct kvec *vec = &rqstp->rq_res.head[0]; 200 struct kvec *vec = &rqstp->rq_res.head[0];
182 char *cp = (char*)p; 201 char *cp = (char*)p;
@@ -247,10 +266,10 @@ struct svc_deferred_req {
247 u32 prot; /* protocol (UDP or TCP) */ 266 u32 prot; /* protocol (UDP or TCP) */
248 struct sockaddr_in addr; 267 struct sockaddr_in addr;
249 struct svc_sock *svsk; /* where reply must go */ 268 struct svc_sock *svsk; /* where reply must go */
250 u32 daddr; /* where reply must come from */ 269 __be32 daddr; /* where reply must come from */
251 struct cache_deferred_req handle; 270 struct cache_deferred_req handle;
252 int argslen; 271 int argslen;
253 u32 args[0]; 272 __be32 args[0];
254}; 273};
255 274
256/* 275/*
@@ -282,7 +301,7 @@ struct svc_version {
282 * A return value of 0 means drop the request. 301 * A return value of 0 means drop the request.
283 * vs_dispatch == NULL means use default dispatcher. 302 * vs_dispatch == NULL means use default dispatcher.
284 */ 303 */
285 int (*vs_dispatch)(struct svc_rqst *, u32 *); 304 int (*vs_dispatch)(struct svc_rqst *, __be32 *);
286}; 305};
287 306
288/* 307/*