diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback.h | 10 | ||||
-rw-r--r-- | fs/nfs/callback_proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/callback_xdr.c | 106 | ||||
-rw-r--r-- | fs/nfs/client.c | 27 | ||||
-rw-r--r-- | fs/nfs/dir.c | 29 | ||||
-rw-r--r-- | fs/nfs/direct.c | 25 | ||||
-rw-r--r-- | fs/nfs/inode.c | 30 | ||||
-rw-r--r-- | fs/nfs/internal.h | 6 | ||||
-rw-r--r-- | fs/nfs/mount_clnt.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs2xdr.c | 78 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3xdr.c | 118 | ||||
-rw-r--r-- | fs/nfs/nfs4_fs.h | 2 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 16 | ||||
-rw-r--r-- | fs/nfs/nfs4xdr.c | 360 | ||||
-rw-r--r-- | fs/nfs/nfsroot.c | 13 | ||||
-rw-r--r-- | fs/nfs/super.c | 2 | ||||
-rw-r--r-- | fs/nfs/sysctl.c | 5 | ||||
-rw-r--r-- | fs/nfs/write.c | 8 |
19 files changed, 440 insertions, 409 deletions
diff --git a/fs/nfs/callback.h b/fs/nfs/callback.h index 5676163d26..db3d7919c6 100644 --- a/fs/nfs/callback.h +++ b/fs/nfs/callback.h | |||
@@ -31,10 +31,10 @@ struct cb_compound_hdr_arg { | |||
31 | }; | 31 | }; |
32 | 32 | ||
33 | struct cb_compound_hdr_res { | 33 | struct cb_compound_hdr_res { |
34 | uint32_t *status; | 34 | __be32 *status; |
35 | int taglen; | 35 | int taglen; |
36 | const char *tag; | 36 | const char *tag; |
37 | uint32_t *nops; | 37 | __be32 *nops; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | struct cb_getattrargs { | 40 | struct cb_getattrargs { |
@@ -44,7 +44,7 @@ struct cb_getattrargs { | |||
44 | }; | 44 | }; |
45 | 45 | ||
46 | struct cb_getattrres { | 46 | struct cb_getattrres { |
47 | uint32_t status; | 47 | __be32 status; |
48 | uint32_t bitmap[2]; | 48 | uint32_t bitmap[2]; |
49 | uint64_t size; | 49 | uint64_t size; |
50 | uint64_t change_attr; | 50 | uint64_t change_attr; |
@@ -59,8 +59,8 @@ struct cb_recallargs { | |||
59 | uint32_t truncate; | 59 | uint32_t truncate; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | extern unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res); | 62 | extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res); |
63 | extern unsigned nfs4_callback_recall(struct cb_recallargs *args, void *dummy); | 63 | extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy); |
64 | 64 | ||
65 | #ifdef CONFIG_NFS_V4 | 65 | #ifdef CONFIG_NFS_V4 |
66 | extern int nfs_callback_up(void); | 66 | extern int nfs_callback_up(void); |
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index 97cf8f7145..72e55d8375 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -14,7 +14,7 @@ | |||
14 | 14 | ||
15 | #define NFSDBG_FACILITY NFSDBG_CALLBACK | 15 | #define NFSDBG_FACILITY NFSDBG_CALLBACK |
16 | 16 | ||
17 | unsigned nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res) | 17 | __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res) |
18 | { | 18 | { |
19 | struct nfs_client *clp; | 19 | struct nfs_client *clp; |
20 | struct nfs_delegation *delegation; | 20 | struct nfs_delegation *delegation; |
@@ -55,11 +55,11 @@ out: | |||
55 | return res->status; | 55 | return res->status; |
56 | } | 56 | } |
57 | 57 | ||
58 | unsigned nfs4_callback_recall(struct cb_recallargs *args, void *dummy) | 58 | __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy) |
59 | { | 59 | { |
60 | struct nfs_client *clp; | 60 | struct nfs_client *clp; |
61 | struct inode *inode; | 61 | struct inode *inode; |
62 | unsigned res; | 62 | __be32 res; |
63 | 63 | ||
64 | res = htonl(NFS4ERR_BADHANDLE); | 64 | res = htonl(NFS4ERR_BADHANDLE); |
65 | clp = nfs_find_client(args->addr, 4); | 65 | clp = nfs_find_client(args->addr, 4); |
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 29f9321920..f8ea1f51f5 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -22,9 +22,9 @@ | |||
22 | 22 | ||
23 | #define NFSDBG_FACILITY NFSDBG_CALLBACK | 23 | #define NFSDBG_FACILITY NFSDBG_CALLBACK |
24 | 24 | ||
25 | typedef unsigned (*callback_process_op_t)(void *, void *); | 25 | typedef __be32 (*callback_process_op_t)(void *, void *); |
26 | typedef unsigned (*callback_decode_arg_t)(struct svc_rqst *, struct xdr_stream *, void *); | 26 | typedef __be32 (*callback_decode_arg_t)(struct svc_rqst *, struct xdr_stream *, void *); |
27 | typedef unsigned (*callback_encode_res_t)(struct svc_rqst *, struct xdr_stream *, void *); | 27 | typedef __be32 (*callback_encode_res_t)(struct svc_rqst *, struct xdr_stream *, void *); |
28 | 28 | ||
29 | 29 | ||
30 | struct callback_op { | 30 | struct callback_op { |
@@ -36,24 +36,24 @@ struct callback_op { | |||
36 | 36 | ||
37 | static struct callback_op callback_ops[]; | 37 | static struct callback_op callback_ops[]; |
38 | 38 | ||
39 | static int nfs4_callback_null(struct svc_rqst *rqstp, void *argp, void *resp) | 39 | static __be32 nfs4_callback_null(struct svc_rqst *rqstp, void *argp, void *resp) |
40 | { | 40 | { |
41 | return htonl(NFS4_OK); | 41 | return htonl(NFS4_OK); |
42 | } | 42 | } |
43 | 43 | ||
44 | static int nfs4_decode_void(struct svc_rqst *rqstp, uint32_t *p, void *dummy) | 44 | static int nfs4_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
45 | { | 45 | { |
46 | return xdr_argsize_check(rqstp, p); | 46 | return xdr_argsize_check(rqstp, p); |
47 | } | 47 | } |
48 | 48 | ||
49 | static int nfs4_encode_void(struct svc_rqst *rqstp, uint32_t *p, void *dummy) | 49 | static int nfs4_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy) |
50 | { | 50 | { |
51 | return xdr_ressize_check(rqstp, p); | 51 | return xdr_ressize_check(rqstp, p); |
52 | } | 52 | } |
53 | 53 | ||
54 | static uint32_t *read_buf(struct xdr_stream *xdr, int nbytes) | 54 | static __be32 *read_buf(struct xdr_stream *xdr, int nbytes) |
55 | { | 55 | { |
56 | uint32_t *p; | 56 | __be32 *p; |
57 | 57 | ||
58 | p = xdr_inline_decode(xdr, nbytes); | 58 | p = xdr_inline_decode(xdr, nbytes); |
59 | if (unlikely(p == NULL)) | 59 | if (unlikely(p == NULL)) |
@@ -61,9 +61,9 @@ static uint32_t *read_buf(struct xdr_stream *xdr, int nbytes) | |||
61 | return p; | 61 | return p; |
62 | } | 62 | } |
63 | 63 | ||
64 | static unsigned decode_string(struct xdr_stream *xdr, unsigned int *len, const char **str) | 64 | static __be32 decode_string(struct xdr_stream *xdr, unsigned int *len, const char **str) |
65 | { | 65 | { |
66 | uint32_t *p; | 66 | __be32 *p; |
67 | 67 | ||
68 | p = read_buf(xdr, 4); | 68 | p = read_buf(xdr, 4); |
69 | if (unlikely(p == NULL)) | 69 | if (unlikely(p == NULL)) |
@@ -81,9 +81,9 @@ static unsigned decode_string(struct xdr_stream *xdr, unsigned int *len, const c | |||
81 | return 0; | 81 | return 0; |
82 | } | 82 | } |
83 | 83 | ||
84 | static unsigned decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh) | 84 | static __be32 decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh) |
85 | { | 85 | { |
86 | uint32_t *p; | 86 | __be32 *p; |
87 | 87 | ||
88 | p = read_buf(xdr, 4); | 88 | p = read_buf(xdr, 4); |
89 | if (unlikely(p == NULL)) | 89 | if (unlikely(p == NULL)) |
@@ -99,9 +99,9 @@ static unsigned decode_fh(struct xdr_stream *xdr, struct nfs_fh *fh) | |||
99 | return 0; | 99 | return 0; |
100 | } | 100 | } |
101 | 101 | ||
102 | static unsigned decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) | 102 | static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) |
103 | { | 103 | { |
104 | uint32_t *p; | 104 | __be32 *p; |
105 | unsigned int attrlen; | 105 | unsigned int attrlen; |
106 | 106 | ||
107 | p = read_buf(xdr, 4); | 107 | p = read_buf(xdr, 4); |
@@ -118,9 +118,9 @@ static unsigned decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static unsigned decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) | 121 | static __be32 decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) |
122 | { | 122 | { |
123 | uint32_t *p; | 123 | __be32 *p; |
124 | 124 | ||
125 | p = read_buf(xdr, 16); | 125 | p = read_buf(xdr, 16); |
126 | if (unlikely(p == NULL)) | 126 | if (unlikely(p == NULL)) |
@@ -129,11 +129,11 @@ static unsigned decode_stateid(struct xdr_stream *xdr, nfs4_stateid *stateid) | |||
129 | return 0; | 129 | return 0; |
130 | } | 130 | } |
131 | 131 | ||
132 | static unsigned decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr) | 132 | static __be32 decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compound_hdr_arg *hdr) |
133 | { | 133 | { |
134 | uint32_t *p; | 134 | __be32 *p; |
135 | unsigned int minor_version; | 135 | unsigned int minor_version; |
136 | unsigned status; | 136 | __be32 status; |
137 | 137 | ||
138 | status = decode_string(xdr, &hdr->taglen, &hdr->tag); | 138 | status = decode_string(xdr, &hdr->taglen, &hdr->tag); |
139 | if (unlikely(status != 0)) | 139 | if (unlikely(status != 0)) |
@@ -159,9 +159,9 @@ static unsigned decode_compound_hdr_arg(struct xdr_stream *xdr, struct cb_compou | |||
159 | return 0; | 159 | return 0; |
160 | } | 160 | } |
161 | 161 | ||
162 | static unsigned decode_op_hdr(struct xdr_stream *xdr, unsigned int *op) | 162 | static __be32 decode_op_hdr(struct xdr_stream *xdr, unsigned int *op) |
163 | { | 163 | { |
164 | uint32_t *p; | 164 | __be32 *p; |
165 | p = read_buf(xdr, 4); | 165 | p = read_buf(xdr, 4); |
166 | if (unlikely(p == NULL)) | 166 | if (unlikely(p == NULL)) |
167 | return htonl(NFS4ERR_RESOURCE); | 167 | return htonl(NFS4ERR_RESOURCE); |
@@ -169,9 +169,9 @@ static unsigned decode_op_hdr(struct xdr_stream *xdr, unsigned int *op) | |||
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
171 | 171 | ||
172 | static unsigned decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_getattrargs *args) | 172 | static __be32 decode_getattr_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_getattrargs *args) |
173 | { | 173 | { |
174 | unsigned status; | 174 | __be32 status; |
175 | 175 | ||
176 | status = decode_fh(xdr, &args->fh); | 176 | status = decode_fh(xdr, &args->fh); |
177 | if (unlikely(status != 0)) | 177 | if (unlikely(status != 0)) |
@@ -183,10 +183,10 @@ out: | |||
183 | return status; | 183 | return status; |
184 | } | 184 | } |
185 | 185 | ||
186 | static unsigned decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_recallargs *args) | 186 | static __be32 decode_recall_args(struct svc_rqst *rqstp, struct xdr_stream *xdr, struct cb_recallargs *args) |
187 | { | 187 | { |
188 | uint32_t *p; | 188 | __be32 *p; |
189 | unsigned status; | 189 | __be32 status; |
190 | 190 | ||
191 | args->addr = &rqstp->rq_addr; | 191 | args->addr = &rqstp->rq_addr; |
192 | status = decode_stateid(xdr, &args->stateid); | 192 | status = decode_stateid(xdr, &args->stateid); |
@@ -204,9 +204,9 @@ out: | |||
204 | return status; | 204 | return status; |
205 | } | 205 | } |
206 | 206 | ||
207 | static unsigned encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) | 207 | static __be32 encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) |
208 | { | 208 | { |
209 | uint32_t *p; | 209 | __be32 *p; |
210 | 210 | ||
211 | p = xdr_reserve_space(xdr, 4 + len); | 211 | p = xdr_reserve_space(xdr, 4 + len); |
212 | if (unlikely(p == NULL)) | 212 | if (unlikely(p == NULL)) |
@@ -217,10 +217,10 @@ static unsigned encode_string(struct xdr_stream *xdr, unsigned int len, const ch | |||
217 | 217 | ||
218 | #define CB_SUPPORTED_ATTR0 (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) | 218 | #define CB_SUPPORTED_ATTR0 (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) |
219 | #define CB_SUPPORTED_ATTR1 (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) | 219 | #define CB_SUPPORTED_ATTR1 (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) |
220 | static unsigned encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, uint32_t **savep) | 220 | static __be32 encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitmap, __be32 **savep) |
221 | { | 221 | { |
222 | uint32_t bm[2]; | 222 | __be32 bm[2]; |
223 | uint32_t *p; | 223 | __be32 *p; |
224 | 224 | ||
225 | bm[0] = htonl(bitmap[0] & CB_SUPPORTED_ATTR0); | 225 | bm[0] = htonl(bitmap[0] & CB_SUPPORTED_ATTR0); |
226 | bm[1] = htonl(bitmap[1] & CB_SUPPORTED_ATTR1); | 226 | bm[1] = htonl(bitmap[1] & CB_SUPPORTED_ATTR1); |
@@ -247,9 +247,9 @@ static unsigned encode_attr_bitmap(struct xdr_stream *xdr, const uint32_t *bitma | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | static unsigned encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change) | 250 | static __be32 encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t change) |
251 | { | 251 | { |
252 | uint32_t *p; | 252 | __be32 *p; |
253 | 253 | ||
254 | if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) | 254 | if (!(bitmap[0] & FATTR4_WORD0_CHANGE)) |
255 | return 0; | 255 | return 0; |
@@ -260,9 +260,9 @@ static unsigned encode_attr_change(struct xdr_stream *xdr, const uint32_t *bitma | |||
260 | return 0; | 260 | return 0; |
261 | } | 261 | } |
262 | 262 | ||
263 | static unsigned encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size) | 263 | static __be32 encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, uint64_t size) |
264 | { | 264 | { |
265 | uint32_t *p; | 265 | __be32 *p; |
266 | 266 | ||
267 | if (!(bitmap[0] & FATTR4_WORD0_SIZE)) | 267 | if (!(bitmap[0] & FATTR4_WORD0_SIZE)) |
268 | return 0; | 268 | return 0; |
@@ -273,9 +273,9 @@ static unsigned encode_attr_size(struct xdr_stream *xdr, const uint32_t *bitmap, | |||
273 | return 0; | 273 | return 0; |
274 | } | 274 | } |
275 | 275 | ||
276 | static unsigned encode_attr_time(struct xdr_stream *xdr, const struct timespec *time) | 276 | static __be32 encode_attr_time(struct xdr_stream *xdr, const struct timespec *time) |
277 | { | 277 | { |
278 | uint32_t *p; | 278 | __be32 *p; |
279 | 279 | ||
280 | p = xdr_reserve_space(xdr, 12); | 280 | p = xdr_reserve_space(xdr, 12); |
281 | if (unlikely(p == 0)) | 281 | if (unlikely(p == 0)) |
@@ -285,23 +285,23 @@ static unsigned encode_attr_time(struct xdr_stream *xdr, const struct timespec * | |||
285 | return 0; | 285 | return 0; |
286 | } | 286 | } |
287 | 287 | ||
288 | static unsigned encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time) | 288 | static __be32 encode_attr_ctime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time) |
289 | { | 289 | { |
290 | if (!(bitmap[1] & FATTR4_WORD1_TIME_METADATA)) | 290 | if (!(bitmap[1] & FATTR4_WORD1_TIME_METADATA)) |
291 | return 0; | 291 | return 0; |
292 | return encode_attr_time(xdr,time); | 292 | return encode_attr_time(xdr,time); |
293 | } | 293 | } |
294 | 294 | ||
295 | static unsigned encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time) | 295 | static __be32 encode_attr_mtime(struct xdr_stream *xdr, const uint32_t *bitmap, const struct timespec *time) |
296 | { | 296 | { |
297 | if (!(bitmap[1] & FATTR4_WORD1_TIME_MODIFY)) | 297 | if (!(bitmap[1] & FATTR4_WORD1_TIME_MODIFY)) |
298 | return 0; | 298 | return 0; |
299 | return encode_attr_time(xdr,time); | 299 | return encode_attr_time(xdr,time); |
300 | } | 300 | } |
301 | 301 | ||
302 | static unsigned encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr) | 302 | static __be32 encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compound_hdr_res *hdr) |
303 | { | 303 | { |
304 | unsigned status; | 304 | __be32 status; |
305 | 305 | ||
306 | hdr->status = xdr_reserve_space(xdr, 4); | 306 | hdr->status = xdr_reserve_space(xdr, 4); |
307 | if (unlikely(hdr->status == NULL)) | 307 | if (unlikely(hdr->status == NULL)) |
@@ -315,9 +315,9 @@ static unsigned encode_compound_hdr_res(struct xdr_stream *xdr, struct cb_compou | |||
315 | return 0; | 315 | return 0; |
316 | } | 316 | } |
317 | 317 | ||
318 | static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res) | 318 | static __be32 encode_op_hdr(struct xdr_stream *xdr, uint32_t op, __be32 res) |
319 | { | 319 | { |
320 | uint32_t *p; | 320 | __be32 *p; |
321 | 321 | ||
322 | p = xdr_reserve_space(xdr, 8); | 322 | p = xdr_reserve_space(xdr, 8); |
323 | if (unlikely(p == NULL)) | 323 | if (unlikely(p == NULL)) |
@@ -327,10 +327,10 @@ static unsigned encode_op_hdr(struct xdr_stream *xdr, uint32_t op, uint32_t res) | |||
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
329 | 329 | ||
330 | static unsigned encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res) | 330 | static __be32 encode_getattr_res(struct svc_rqst *rqstp, struct xdr_stream *xdr, const struct cb_getattrres *res) |
331 | { | 331 | { |
332 | uint32_t *savep = NULL; | 332 | __be32 *savep = NULL; |
333 | unsigned status = res->status; | 333 | __be32 status = res->status; |
334 | 334 | ||
335 | if (unlikely(status != 0)) | 335 | if (unlikely(status != 0)) |
336 | goto out; | 336 | goto out; |
@@ -353,15 +353,15 @@ out: | |||
353 | return status; | 353 | return status; |
354 | } | 354 | } |
355 | 355 | ||
356 | static unsigned process_op(struct svc_rqst *rqstp, | 356 | static __be32 process_op(struct svc_rqst *rqstp, |
357 | struct xdr_stream *xdr_in, void *argp, | 357 | struct xdr_stream *xdr_in, void *argp, |
358 | struct xdr_stream *xdr_out, void *resp) | 358 | struct xdr_stream *xdr_out, void *resp) |
359 | { | 359 | { |
360 | struct callback_op *op = &callback_ops[0]; | 360 | struct callback_op *op = &callback_ops[0]; |
361 | unsigned int op_nr = OP_CB_ILLEGAL; | 361 | unsigned int op_nr = OP_CB_ILLEGAL; |
362 | unsigned int status = 0; | 362 | __be32 status = 0; |
363 | long maxlen; | 363 | long maxlen; |
364 | unsigned res; | 364 | __be32 res; |
365 | 365 | ||
366 | dprintk("%s: start\n", __FUNCTION__); | 366 | dprintk("%s: start\n", __FUNCTION__); |
367 | status = decode_op_hdr(xdr_in, &op_nr); | 367 | status = decode_op_hdr(xdr_in, &op_nr); |
@@ -399,20 +399,20 @@ static unsigned process_op(struct svc_rqst *rqstp, | |||
399 | /* | 399 | /* |
400 | * Decode, process and encode a COMPOUND | 400 | * Decode, process and encode a COMPOUND |
401 | */ | 401 | */ |
402 | static int nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp) | 402 | static __be32 nfs4_callback_compound(struct svc_rqst *rqstp, void *argp, void *resp) |
403 | { | 403 | { |
404 | struct cb_compound_hdr_arg hdr_arg; | 404 | struct cb_compound_hdr_arg hdr_arg; |
405 | struct cb_compound_hdr_res hdr_res; | 405 | struct cb_compound_hdr_res hdr_res; |
406 | struct xdr_stream xdr_in, xdr_out; | 406 | struct xdr_stream xdr_in, xdr_out; |
407 | uint32_t *p; | 407 | __be32 *p; |
408 | unsigned int status; | 408 | __be32 status; |
409 | unsigned int nops = 1; | 409 | unsigned int nops = 1; |
410 | 410 | ||
411 | dprintk("%s: start\n", __FUNCTION__); | 411 | dprintk("%s: start\n", __FUNCTION__); |
412 | 412 | ||
413 | xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base); | 413 | xdr_init_decode(&xdr_in, &rqstp->rq_arg, rqstp->rq_arg.head[0].iov_base); |
414 | 414 | ||
415 | p = (uint32_t*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len); | 415 | p = (__be32*)((char *)rqstp->rq_res.head[0].iov_base + rqstp->rq_res.head[0].iov_len); |
416 | xdr_init_encode(&xdr_out, &rqstp->rq_res, p); | 416 | xdr_init_encode(&xdr_out, &rqstp->rq_res, p); |
417 | 417 | ||
418 | decode_compound_hdr_arg(&xdr_in, &hdr_arg); | 418 | decode_compound_hdr_arg(&xdr_in, &hdr_arg); |
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 34c3996bd0..5fea638743 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -232,11 +232,15 @@ void nfs_put_client(struct nfs_client *clp) | |||
232 | * Find a client by address | 232 | * Find a client by address |
233 | * - caller must hold nfs_client_lock | 233 | * - caller must hold nfs_client_lock |
234 | */ | 234 | */ |
235 | static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion) | 235 | static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int nfsversion, int match_port) |
236 | { | 236 | { |
237 | struct nfs_client *clp; | 237 | struct nfs_client *clp; |
238 | 238 | ||
239 | list_for_each_entry(clp, &nfs_client_list, cl_share_link) { | 239 | list_for_each_entry(clp, &nfs_client_list, cl_share_link) { |
240 | /* Don't match clients that failed to initialise properly */ | ||
241 | if (clp->cl_cons_state < 0) | ||
242 | continue; | ||
243 | |||
240 | /* Different NFS versions cannot share the same nfs_client */ | 244 | /* Different NFS versions cannot share the same nfs_client */ |
241 | if (clp->cl_nfsversion != nfsversion) | 245 | if (clp->cl_nfsversion != nfsversion) |
242 | continue; | 246 | continue; |
@@ -245,7 +249,7 @@ static struct nfs_client *__nfs_find_client(const struct sockaddr_in *addr, int | |||
245 | sizeof(clp->cl_addr.sin_addr)) != 0) | 249 | sizeof(clp->cl_addr.sin_addr)) != 0) |
246 | continue; | 250 | continue; |
247 | 251 | ||
248 | if (clp->cl_addr.sin_port == addr->sin_port) | 252 | if (!match_port || clp->cl_addr.sin_port == addr->sin_port) |
249 | goto found; | 253 | goto found; |
250 | } | 254 | } |
251 | 255 | ||
@@ -265,11 +269,12 @@ struct nfs_client *nfs_find_client(const struct sockaddr_in *addr, int nfsversio | |||
265 | struct nfs_client *clp; | 269 | struct nfs_client *clp; |
266 | 270 | ||
267 | spin_lock(&nfs_client_lock); | 271 | spin_lock(&nfs_client_lock); |
268 | clp = __nfs_find_client(addr, nfsversion); | 272 | clp = __nfs_find_client(addr, nfsversion, 0); |
269 | spin_unlock(&nfs_client_lock); | 273 | spin_unlock(&nfs_client_lock); |
270 | 274 | if (clp != NULL && clp->cl_cons_state != NFS_CS_READY) { | |
271 | BUG_ON(clp && clp->cl_cons_state == 0); | 275 | nfs_put_client(clp); |
272 | 276 | clp = NULL; | |
277 | } | ||
273 | return clp; | 278 | return clp; |
274 | } | 279 | } |
275 | 280 | ||
@@ -292,7 +297,7 @@ static struct nfs_client *nfs_get_client(const char *hostname, | |||
292 | do { | 297 | do { |
293 | spin_lock(&nfs_client_lock); | 298 | spin_lock(&nfs_client_lock); |
294 | 299 | ||
295 | clp = __nfs_find_client(addr, nfsversion); | 300 | clp = __nfs_find_client(addr, nfsversion, 1); |
296 | if (clp) | 301 | if (clp) |
297 | goto found_client; | 302 | goto found_client; |
298 | if (new) | 303 | if (new) |
@@ -849,6 +854,7 @@ error: | |||
849 | */ | 854 | */ |
850 | static int nfs4_init_client(struct nfs_client *clp, | 855 | static int nfs4_init_client(struct nfs_client *clp, |
851 | int proto, int timeo, int retrans, | 856 | int proto, int timeo, int retrans, |
857 | const char *ip_addr, | ||
852 | rpc_authflavor_t authflavour) | 858 | rpc_authflavor_t authflavour) |
853 | { | 859 | { |
854 | int error; | 860 | int error; |
@@ -865,6 +871,7 @@ static int nfs4_init_client(struct nfs_client *clp, | |||
865 | error = nfs_create_rpc_client(clp, proto, timeo, retrans, authflavour); | 871 | error = nfs_create_rpc_client(clp, proto, timeo, retrans, authflavour); |
866 | if (error < 0) | 872 | if (error < 0) |
867 | goto error; | 873 | goto error; |
874 | memcpy(clp->cl_ipaddr, ip_addr, sizeof(clp->cl_ipaddr)); | ||
868 | 875 | ||
869 | error = nfs_idmap_new(clp); | 876 | error = nfs_idmap_new(clp); |
870 | if (error < 0) { | 877 | if (error < 0) { |
@@ -888,6 +895,7 @@ error: | |||
888 | */ | 895 | */ |
889 | static int nfs4_set_client(struct nfs_server *server, | 896 | static int nfs4_set_client(struct nfs_server *server, |
890 | const char *hostname, const struct sockaddr_in *addr, | 897 | const char *hostname, const struct sockaddr_in *addr, |
898 | const char *ip_addr, | ||
891 | rpc_authflavor_t authflavour, | 899 | rpc_authflavor_t authflavour, |
892 | int proto, int timeo, int retrans) | 900 | int proto, int timeo, int retrans) |
893 | { | 901 | { |
@@ -902,7 +910,7 @@ static int nfs4_set_client(struct nfs_server *server, | |||
902 | error = PTR_ERR(clp); | 910 | error = PTR_ERR(clp); |
903 | goto error; | 911 | goto error; |
904 | } | 912 | } |
905 | error = nfs4_init_client(clp, proto, timeo, retrans, authflavour); | 913 | error = nfs4_init_client(clp, proto, timeo, retrans, ip_addr, authflavour); |
906 | if (error < 0) | 914 | if (error < 0) |
907 | goto error_put; | 915 | goto error_put; |
908 | 916 | ||
@@ -971,7 +979,7 @@ struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data, | |||
971 | return ERR_PTR(-ENOMEM); | 979 | return ERR_PTR(-ENOMEM); |
972 | 980 | ||
973 | /* Get a client record */ | 981 | /* Get a client record */ |
974 | error = nfs4_set_client(server, hostname, addr, authflavour, | 982 | error = nfs4_set_client(server, hostname, addr, ip_addr, authflavour, |
975 | data->proto, data->timeo, data->retrans); | 983 | data->proto, data->timeo, data->retrans); |
976 | if (error < 0) | 984 | if (error < 0) |
977 | goto error; | 985 | goto error; |
@@ -1041,6 +1049,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, | |||
1041 | /* Get a client representation. | 1049 | /* Get a client representation. |
1042 | * Note: NFSv4 always uses TCP, */ | 1050 | * Note: NFSv4 always uses TCP, */ |
1043 | error = nfs4_set_client(server, data->hostname, data->addr, | 1051 | error = nfs4_set_client(server, data->hostname, data->addr, |
1052 | parent_client->cl_ipaddr, | ||
1044 | data->authflavor, | 1053 | data->authflavor, |
1045 | parent_server->client->cl_xprt->prot, | 1054 | parent_server->client->cl_xprt->prot, |
1046 | parent_client->retrans_timeo, | 1055 | parent_client->retrans_timeo, |
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 481f8892a9..b34cd16f47 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
@@ -142,12 +142,12 @@ nfs_opendir(struct inode *inode, struct file *filp) | |||
142 | return res; | 142 | return res; |
143 | } | 143 | } |
144 | 144 | ||
145 | typedef u32 * (*decode_dirent_t)(u32 *, struct nfs_entry *, int); | 145 | typedef __be32 * (*decode_dirent_t)(__be32 *, struct nfs_entry *, int); |
146 | typedef struct { | 146 | typedef struct { |
147 | struct file *file; | 147 | struct file *file; |
148 | struct page *page; | 148 | struct page *page; |
149 | unsigned long page_index; | 149 | unsigned long page_index; |
150 | u32 *ptr; | 150 | __be32 *ptr; |
151 | u64 *dir_cookie; | 151 | u64 *dir_cookie; |
152 | loff_t current_index; | 152 | loff_t current_index; |
153 | struct nfs_entry *entry; | 153 | struct nfs_entry *entry; |
@@ -203,8 +203,10 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
203 | * Note: assumes we have exclusive access to this mapping either | 203 | * Note: assumes we have exclusive access to this mapping either |
204 | * through inode->i_mutex or some other mechanism. | 204 | * through inode->i_mutex or some other mechanism. |
205 | */ | 205 | */ |
206 | if (page->index == 0) | 206 | if (page->index == 0 && invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1) < 0) { |
207 | invalidate_inode_pages2_range(inode->i_mapping, PAGE_CACHE_SIZE, -1); | 207 | /* Should never happen */ |
208 | nfs_zap_mapping(inode, inode->i_mapping); | ||
209 | } | ||
208 | unlock_page(page); | 210 | unlock_page(page); |
209 | return 0; | 211 | return 0; |
210 | error: | 212 | error: |
@@ -218,7 +220,7 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page *page) | |||
218 | static inline | 220 | static inline |
219 | int dir_decode(nfs_readdir_descriptor_t *desc) | 221 | int dir_decode(nfs_readdir_descriptor_t *desc) |
220 | { | 222 | { |
221 | u32 *p = desc->ptr; | 223 | __be32 *p = desc->ptr; |
222 | p = desc->decode(p, desc->entry, desc->plus); | 224 | p = desc->decode(p, desc->entry, desc->plus); |
223 | if (IS_ERR(p)) | 225 | if (IS_ERR(p)) |
224 | return PTR_ERR(p); | 226 | return PTR_ERR(p); |
@@ -933,8 +935,17 @@ static struct dentry *nfs_lookup(struct inode *dir, struct dentry * dentry, stru | |||
933 | 935 | ||
934 | no_entry: | 936 | no_entry: |
935 | res = d_materialise_unique(dentry, inode); | 937 | res = d_materialise_unique(dentry, inode); |
936 | if (res != NULL) | 938 | if (res != NULL) { |
939 | struct dentry *parent; | ||
940 | if (IS_ERR(res)) | ||
941 | goto out_unlock; | ||
942 | /* Was a directory renamed! */ | ||
943 | parent = dget_parent(res); | ||
944 | if (!IS_ROOT(parent)) | ||
945 | nfs_mark_for_revalidate(parent->d_inode); | ||
946 | dput(parent); | ||
937 | dentry = res; | 947 | dentry = res; |
948 | } | ||
938 | nfs_renew_times(dentry); | 949 | nfs_renew_times(dentry); |
939 | nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); | 950 | nfs_set_verifier(dentry, nfs_save_change_attribute(dir)); |
940 | out_unlock: | 951 | out_unlock: |
@@ -1130,6 +1141,8 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) | |||
1130 | alias = d_materialise_unique(dentry, inode); | 1141 | alias = d_materialise_unique(dentry, inode); |
1131 | if (alias != NULL) { | 1142 | if (alias != NULL) { |
1132 | dput(dentry); | 1143 | dput(dentry); |
1144 | if (IS_ERR(alias)) | ||
1145 | return NULL; | ||
1133 | dentry = alias; | 1146 | dentry = alias; |
1134 | } | 1147 | } |
1135 | 1148 | ||
@@ -1517,8 +1530,8 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym | |||
1517 | pagevec_init(&lru_pvec, 0); | 1530 | pagevec_init(&lru_pvec, 0); |
1518 | if (!add_to_page_cache(page, dentry->d_inode->i_mapping, 0, | 1531 | if (!add_to_page_cache(page, dentry->d_inode->i_mapping, 0, |
1519 | GFP_KERNEL)) { | 1532 | GFP_KERNEL)) { |
1520 | if (!pagevec_add(&lru_pvec, page)) | 1533 | pagevec_add(&lru_pvec, page); |
1521 | __pagevec_lru_add(&lru_pvec); | 1534 | pagevec_lru_add(&lru_pvec); |
1522 | SetPageUptodate(page); | 1535 | SetPageUptodate(page); |
1523 | unlock_page(page); | 1536 | unlock_page(page); |
1524 | } else | 1537 | } else |
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 9f7f8b9ea1..bdfabf854a 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -497,6 +497,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode | |||
497 | if (dreq->commit_data != NULL) | 497 | if (dreq->commit_data != NULL) |
498 | nfs_commit_free(dreq->commit_data); | 498 | nfs_commit_free(dreq->commit_data); |
499 | nfs_direct_free_writedata(dreq); | 499 | nfs_direct_free_writedata(dreq); |
500 | nfs_zap_mapping(inode, inode->i_mapping); | ||
500 | nfs_direct_complete(dreq); | 501 | nfs_direct_complete(dreq); |
501 | } | 502 | } |
502 | } | 503 | } |
@@ -517,6 +518,7 @@ static void nfs_direct_write_complete(struct nfs_direct_req *dreq, struct inode | |||
517 | { | 518 | { |
518 | nfs_end_data_update(inode); | 519 | nfs_end_data_update(inode); |
519 | nfs_direct_free_writedata(dreq); | 520 | nfs_direct_free_writedata(dreq); |
521 | nfs_zap_mapping(inode, inode->i_mapping); | ||
520 | nfs_direct_complete(dreq); | 522 | nfs_direct_complete(dreq); |
521 | } | 523 | } |
522 | #endif | 524 | #endif |
@@ -532,10 +534,12 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata) | |||
532 | 534 | ||
533 | spin_lock(&dreq->lock); | 535 | spin_lock(&dreq->lock); |
534 | 536 | ||
535 | if (likely(status >= 0)) | 537 | if (unlikely(status < 0)) { |
536 | dreq->count += data->res.count; | 538 | dreq->error = status; |
537 | else | 539 | goto out_unlock; |
538 | dreq->error = task->tk_status; | 540 | } |
541 | |||
542 | dreq->count += data->res.count; | ||
539 | 543 | ||
540 | if (data->res.verf->committed != NFS_FILE_SYNC) { | 544 | if (data->res.verf->committed != NFS_FILE_SYNC) { |
541 | switch (dreq->flags) { | 545 | switch (dreq->flags) { |
@@ -550,7 +554,7 @@ static void nfs_direct_write_result(struct rpc_task *task, void *calldata) | |||
550 | } | 554 | } |
551 | } | 555 | } |
552 | } | 556 | } |
553 | 557 | out_unlock: | |
554 | spin_unlock(&dreq->lock); | 558 | spin_unlock(&dreq->lock); |
555 | } | 559 | } |
556 | 560 | ||
@@ -828,17 +832,6 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov, | |||
828 | 832 | ||
829 | retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos); | 833 | retval = nfs_direct_write(iocb, (unsigned long) buf, count, pos); |
830 | 834 | ||
831 | /* | ||
832 | * XXX: nfs_end_data_update() already ensures this file's | ||
833 | * cached data is subsequently invalidated. Do we really | ||
834 | * need to call invalidate_inode_pages2() again here? | ||
835 | * | ||
836 | * For aio writes, this invalidation will almost certainly | ||
837 | * occur before the writes complete. Kind of racey. | ||
838 | */ | ||
839 | if (mapping->nrpages) | ||
840 | invalidate_inode_pages2(mapping); | ||
841 | |||
842 | if (retval > 0) | 835 | if (retval > 0) |
843 | iocb->ki_pos = pos + retval; | 836 | iocb->ki_pos = pos + retval; |
844 | 837 | ||
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index bc9376ca86..08cc4c5919 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -131,6 +131,15 @@ void nfs_zap_caches(struct inode *inode) | |||
131 | spin_unlock(&inode->i_lock); | 131 | spin_unlock(&inode->i_lock); |
132 | } | 132 | } |
133 | 133 | ||
134 | void nfs_zap_mapping(struct inode *inode, struct address_space *mapping) | ||
135 | { | ||
136 | if (mapping->nrpages != 0) { | ||
137 | spin_lock(&inode->i_lock); | ||
138 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_DATA; | ||
139 | spin_unlock(&inode->i_lock); | ||
140 | } | ||
141 | } | ||
142 | |||
134 | static void nfs_zap_acl_cache(struct inode *inode) | 143 | static void nfs_zap_acl_cache(struct inode *inode) |
135 | { | 144 | { |
136 | void (*clear_acl_cache)(struct inode *); | 145 | void (*clear_acl_cache)(struct inode *); |
@@ -574,7 +583,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode) | |||
574 | 583 | ||
575 | nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); | 584 | nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE); |
576 | lock_kernel(); | 585 | lock_kernel(); |
577 | if (!inode || is_bad_inode(inode)) | 586 | if (is_bad_inode(inode)) |
578 | goto out_nowait; | 587 | goto out_nowait; |
579 | if (NFS_STALE(inode)) | 588 | if (NFS_STALE(inode)) |
580 | goto out_nowait; | 589 | goto out_nowait; |
@@ -671,13 +680,20 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
671 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) | 680 | if ((nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) |
672 | || nfs_attribute_timeout(inode)) | 681 | || nfs_attribute_timeout(inode)) |
673 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); | 682 | ret = __nfs_revalidate_inode(NFS_SERVER(inode), inode); |
683 | if (ret < 0) | ||
684 | goto out; | ||
674 | 685 | ||
675 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { | 686 | if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { |
676 | nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE); | 687 | if (mapping->nrpages != 0) { |
677 | if (S_ISREG(inode->i_mode)) | 688 | if (S_ISREG(inode->i_mode)) { |
678 | nfs_sync_mapping(mapping); | 689 | ret = nfs_sync_mapping(mapping); |
679 | invalidate_inode_pages2(mapping); | 690 | if (ret < 0) |
680 | 691 | goto out; | |
692 | } | ||
693 | ret = invalidate_inode_pages2(mapping); | ||
694 | if (ret < 0) | ||
695 | goto out; | ||
696 | } | ||
681 | spin_lock(&inode->i_lock); | 697 | spin_lock(&inode->i_lock); |
682 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; | 698 | nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; |
683 | if (S_ISDIR(inode->i_mode)) { | 699 | if (S_ISDIR(inode->i_mode)) { |
@@ -687,10 +703,12 @@ int nfs_revalidate_mapping(struct inode *inode, struct address_space *mapping) | |||
687 | } | 703 | } |
688 | spin_unlock(&inode->i_lock); | 704 | spin_unlock(&inode->i_lock); |
689 | 705 | ||
706 | nfs_inc_stats(inode, NFSIOS_DATAINVALIDATE); | ||
690 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", | 707 | dfprintk(PAGECACHE, "NFS: (%s/%Ld) data cache invalidated\n", |
691 | inode->i_sb->s_id, | 708 | inode->i_sb->s_id, |
692 | (long long)NFS_FILEID(inode)); | 709 | (long long)NFS_FILEID(inode)); |
693 | } | 710 | } |
711 | out: | ||
694 | return ret; | 712 | return ret; |
695 | } | 713 | } |
696 | 714 | ||
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index bea0b016bd..d205466233 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -93,15 +93,15 @@ extern void nfs_destroy_directcache(void); | |||
93 | /* nfs2xdr.c */ | 93 | /* nfs2xdr.c */ |
94 | extern int nfs_stat_to_errno(int); | 94 | extern int nfs_stat_to_errno(int); |
95 | extern struct rpc_procinfo nfs_procedures[]; | 95 | extern struct rpc_procinfo nfs_procedures[]; |
96 | extern u32 * nfs_decode_dirent(u32 *, struct nfs_entry *, int); | 96 | extern __be32 * nfs_decode_dirent(__be32 *, struct nfs_entry *, int); |
97 | 97 | ||
98 | /* nfs3xdr.c */ | 98 | /* nfs3xdr.c */ |
99 | extern struct rpc_procinfo nfs3_procedures[]; | 99 | extern struct rpc_procinfo nfs3_procedures[]; |
100 | extern u32 *nfs3_decode_dirent(u32 *, struct nfs_entry *, int); | 100 | extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int); |
101 | 101 | ||
102 | /* nfs4xdr.c */ | 102 | /* nfs4xdr.c */ |
103 | #ifdef CONFIG_NFS_V4 | 103 | #ifdef CONFIG_NFS_V4 |
104 | extern u32 *nfs4_decode_dirent(u32 *p, struct nfs_entry *entry, int plus); | 104 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); |
105 | #endif | 105 | #endif |
106 | 106 | ||
107 | /* nfs4proc.c */ | 107 | /* nfs4proc.c */ |
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index d507b02120..f75fe72b41 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
@@ -95,7 +95,7 @@ mnt_create(char *hostname, struct sockaddr_in *srvaddr, int version, | |||
95 | * XDR encode/decode functions for MOUNT | 95 | * XDR encode/decode functions for MOUNT |
96 | */ | 96 | */ |
97 | static int | 97 | static int |
98 | xdr_encode_dirpath(struct rpc_rqst *req, u32 *p, const char *path) | 98 | xdr_encode_dirpath(struct rpc_rqst *req, __be32 *p, const char *path) |
99 | { | 99 | { |
100 | p = xdr_encode_string(p, path); | 100 | p = xdr_encode_string(p, path); |
101 | 101 | ||
@@ -104,7 +104,7 @@ xdr_encode_dirpath(struct rpc_rqst *req, u32 *p, const char *path) | |||
104 | } | 104 | } |
105 | 105 | ||
106 | static int | 106 | static int |
107 | xdr_decode_fhstatus(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res) | 107 | xdr_decode_fhstatus(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res) |
108 | { | 108 | { |
109 | struct nfs_fh *fh = res->fh; | 109 | struct nfs_fh *fh = res->fh; |
110 | 110 | ||
@@ -116,7 +116,7 @@ xdr_decode_fhstatus(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res) | |||
116 | } | 116 | } |
117 | 117 | ||
118 | static int | 118 | static int |
119 | xdr_decode_fhstatus3(struct rpc_rqst *req, u32 *p, struct mnt_fhstatus *res) | 119 | xdr_decode_fhstatus3(struct rpc_rqst *req, __be32 *p, struct mnt_fhstatus *res) |
120 | { | 120 | { |
121 | struct nfs_fh *fh = res->fh; | 121 | struct nfs_fh *fh = res->fh; |
122 | 122 | ||
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index b49501fc0a..3be4e72a02 100644 --- a/fs/nfs/nfs2xdr.c +++ b/fs/nfs/nfs2xdr.c | |||
@@ -66,15 +66,15 @@ | |||
66 | /* | 66 | /* |
67 | * Common NFS XDR functions as inlines | 67 | * Common NFS XDR functions as inlines |
68 | */ | 68 | */ |
69 | static inline u32 * | 69 | static inline __be32 * |
70 | xdr_encode_fhandle(u32 *p, struct nfs_fh *fhandle) | 70 | xdr_encode_fhandle(__be32 *p, struct nfs_fh *fhandle) |
71 | { | 71 | { |
72 | memcpy(p, fhandle->data, NFS2_FHSIZE); | 72 | memcpy(p, fhandle->data, NFS2_FHSIZE); |
73 | return p + XDR_QUADLEN(NFS2_FHSIZE); | 73 | return p + XDR_QUADLEN(NFS2_FHSIZE); |
74 | } | 74 | } |
75 | 75 | ||
76 | static inline u32 * | 76 | static inline __be32 * |
77 | xdr_decode_fhandle(u32 *p, struct nfs_fh *fhandle) | 77 | xdr_decode_fhandle(__be32 *p, struct nfs_fh *fhandle) |
78 | { | 78 | { |
79 | /* NFSv2 handles have a fixed length */ | 79 | /* NFSv2 handles have a fixed length */ |
80 | fhandle->size = NFS2_FHSIZE; | 80 | fhandle->size = NFS2_FHSIZE; |
@@ -82,8 +82,8 @@ xdr_decode_fhandle(u32 *p, struct nfs_fh *fhandle) | |||
82 | return p + XDR_QUADLEN(NFS2_FHSIZE); | 82 | return p + XDR_QUADLEN(NFS2_FHSIZE); |
83 | } | 83 | } |
84 | 84 | ||
85 | static inline u32* | 85 | static inline __be32* |
86 | xdr_encode_time(u32 *p, struct timespec *timep) | 86 | xdr_encode_time(__be32 *p, struct timespec *timep) |
87 | { | 87 | { |
88 | *p++ = htonl(timep->tv_sec); | 88 | *p++ = htonl(timep->tv_sec); |
89 | /* Convert nanoseconds into microseconds */ | 89 | /* Convert nanoseconds into microseconds */ |
@@ -91,8 +91,8 @@ xdr_encode_time(u32 *p, struct timespec *timep) | |||
91 | return p; | 91 | return p; |
92 | } | 92 | } |
93 | 93 | ||
94 | static inline u32* | 94 | static inline __be32* |
95 | xdr_encode_current_server_time(u32 *p, struct timespec *timep) | 95 | xdr_encode_current_server_time(__be32 *p, struct timespec *timep) |
96 | { | 96 | { |
97 | /* | 97 | /* |
98 | * Passing the invalid value useconds=1000000 is a | 98 | * Passing the invalid value useconds=1000000 is a |
@@ -108,8 +108,8 @@ xdr_encode_current_server_time(u32 *p, struct timespec *timep) | |||
108 | return p; | 108 | return p; |
109 | } | 109 | } |
110 | 110 | ||
111 | static inline u32* | 111 | static inline __be32* |
112 | xdr_decode_time(u32 *p, struct timespec *timep) | 112 | xdr_decode_time(__be32 *p, struct timespec *timep) |
113 | { | 113 | { |
114 | timep->tv_sec = ntohl(*p++); | 114 | timep->tv_sec = ntohl(*p++); |
115 | /* Convert microseconds into nanoseconds */ | 115 | /* Convert microseconds into nanoseconds */ |
@@ -117,8 +117,8 @@ xdr_decode_time(u32 *p, struct timespec *timep) | |||
117 | return p; | 117 | return p; |
118 | } | 118 | } |
119 | 119 | ||
120 | static u32 * | 120 | static __be32 * |
121 | xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) | 121 | xdr_decode_fattr(__be32 *p, struct nfs_fattr *fattr) |
122 | { | 122 | { |
123 | u32 rdev; | 123 | u32 rdev; |
124 | fattr->type = (enum nfs_ftype) ntohl(*p++); | 124 | fattr->type = (enum nfs_ftype) ntohl(*p++); |
@@ -146,10 +146,10 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) | |||
146 | return p; | 146 | return p; |
147 | } | 147 | } |
148 | 148 | ||
149 | static inline u32 * | 149 | static inline __be32 * |
150 | xdr_encode_sattr(u32 *p, struct iattr *attr) | 150 | xdr_encode_sattr(__be32 *p, struct iattr *attr) |
151 | { | 151 | { |
152 | const u32 not_set = __constant_htonl(0xFFFFFFFF); | 152 | const __be32 not_set = __constant_htonl(0xFFFFFFFF); |
153 | 153 | ||
154 | *p++ = (attr->ia_valid & ATTR_MODE) ? htonl(attr->ia_mode) : not_set; | 154 | *p++ = (attr->ia_valid & ATTR_MODE) ? htonl(attr->ia_mode) : not_set; |
155 | *p++ = (attr->ia_valid & ATTR_UID) ? htonl(attr->ia_uid) : not_set; | 155 | *p++ = (attr->ia_valid & ATTR_UID) ? htonl(attr->ia_uid) : not_set; |
@@ -184,7 +184,7 @@ xdr_encode_sattr(u32 *p, struct iattr *attr) | |||
184 | * GETATTR, READLINK, STATFS | 184 | * GETATTR, READLINK, STATFS |
185 | */ | 185 | */ |
186 | static int | 186 | static int |
187 | nfs_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh) | 187 | nfs_xdr_fhandle(struct rpc_rqst *req, __be32 *p, struct nfs_fh *fh) |
188 | { | 188 | { |
189 | p = xdr_encode_fhandle(p, fh); | 189 | p = xdr_encode_fhandle(p, fh); |
190 | req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); | 190 | req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); |
@@ -195,7 +195,7 @@ nfs_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh) | |||
195 | * Encode SETATTR arguments | 195 | * Encode SETATTR arguments |
196 | */ | 196 | */ |
197 | static int | 197 | static int |
198 | nfs_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs_sattrargs *args) | 198 | nfs_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs_sattrargs *args) |
199 | { | 199 | { |
200 | p = xdr_encode_fhandle(p, args->fh); | 200 | p = xdr_encode_fhandle(p, args->fh); |
201 | p = xdr_encode_sattr(p, args->sattr); | 201 | p = xdr_encode_sattr(p, args->sattr); |
@@ -208,7 +208,7 @@ nfs_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs_sattrargs *args) | |||
208 | * LOOKUP, REMOVE, RMDIR | 208 | * LOOKUP, REMOVE, RMDIR |
209 | */ | 209 | */ |
210 | static int | 210 | static int |
211 | nfs_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs_diropargs *args) | 211 | nfs_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs_diropargs *args) |
212 | { | 212 | { |
213 | p = xdr_encode_fhandle(p, args->fh); | 213 | p = xdr_encode_fhandle(p, args->fh); |
214 | p = xdr_encode_array(p, args->name, args->len); | 214 | p = xdr_encode_array(p, args->name, args->len); |
@@ -222,7 +222,7 @@ nfs_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs_diropargs *args) | |||
222 | * exactly to the page we want to fetch. | 222 | * exactly to the page we want to fetch. |
223 | */ | 223 | */ |
224 | static int | 224 | static int |
225 | nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args) | 225 | nfs_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) |
226 | { | 226 | { |
227 | struct rpc_auth *auth = req->rq_task->tk_auth; | 227 | struct rpc_auth *auth = req->rq_task->tk_auth; |
228 | unsigned int replen; | 228 | unsigned int replen; |
@@ -246,7 +246,7 @@ nfs_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args) | |||
246 | * Decode READ reply | 246 | * Decode READ reply |
247 | */ | 247 | */ |
248 | static int | 248 | static int |
249 | nfs_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res) | 249 | nfs_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res) |
250 | { | 250 | { |
251 | struct kvec *iov = req->rq_rcv_buf.head; | 251 | struct kvec *iov = req->rq_rcv_buf.head; |
252 | int status, count, recvd, hdrlen; | 252 | int status, count, recvd, hdrlen; |
@@ -286,7 +286,7 @@ nfs_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res) | |||
286 | * Write arguments. Splice the buffer to be written into the iovec. | 286 | * Write arguments. Splice the buffer to be written into the iovec. |
287 | */ | 287 | */ |
288 | static int | 288 | static int |
289 | nfs_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | 289 | nfs_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) |
290 | { | 290 | { |
291 | struct xdr_buf *sndbuf = &req->rq_snd_buf; | 291 | struct xdr_buf *sndbuf = &req->rq_snd_buf; |
292 | u32 offset = (u32)args->offset; | 292 | u32 offset = (u32)args->offset; |
@@ -309,7 +309,7 @@ nfs_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | |||
309 | * CREATE, MKDIR | 309 | * CREATE, MKDIR |
310 | */ | 310 | */ |
311 | static int | 311 | static int |
312 | nfs_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs_createargs *args) | 312 | nfs_xdr_createargs(struct rpc_rqst *req, __be32 *p, struct nfs_createargs *args) |
313 | { | 313 | { |
314 | p = xdr_encode_fhandle(p, args->fh); | 314 | p = xdr_encode_fhandle(p, args->fh); |
315 | p = xdr_encode_array(p, args->name, args->len); | 315 | p = xdr_encode_array(p, args->name, args->len); |
@@ -322,7 +322,7 @@ nfs_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs_createargs *args) | |||
322 | * Encode RENAME arguments | 322 | * Encode RENAME arguments |
323 | */ | 323 | */ |
324 | static int | 324 | static int |
325 | nfs_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs_renameargs *args) | 325 | nfs_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs_renameargs *args) |
326 | { | 326 | { |
327 | p = xdr_encode_fhandle(p, args->fromfh); | 327 | p = xdr_encode_fhandle(p, args->fromfh); |
328 | p = xdr_encode_array(p, args->fromname, args->fromlen); | 328 | p = xdr_encode_array(p, args->fromname, args->fromlen); |
@@ -336,7 +336,7 @@ nfs_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs_renameargs *args) | |||
336 | * Encode LINK arguments | 336 | * Encode LINK arguments |
337 | */ | 337 | */ |
338 | static int | 338 | static int |
339 | nfs_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs_linkargs *args) | 339 | nfs_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs_linkargs *args) |
340 | { | 340 | { |
341 | p = xdr_encode_fhandle(p, args->fromfh); | 341 | p = xdr_encode_fhandle(p, args->fromfh); |
342 | p = xdr_encode_fhandle(p, args->tofh); | 342 | p = xdr_encode_fhandle(p, args->tofh); |
@@ -349,7 +349,7 @@ nfs_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs_linkargs *args) | |||
349 | * Encode SYMLINK arguments | 349 | * Encode SYMLINK arguments |
350 | */ | 350 | */ |
351 | static int | 351 | static int |
352 | nfs_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_symlinkargs *args) | 352 | nfs_xdr_symlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_symlinkargs *args) |
353 | { | 353 | { |
354 | struct xdr_buf *sndbuf = &req->rq_snd_buf; | 354 | struct xdr_buf *sndbuf = &req->rq_snd_buf; |
355 | size_t pad; | 355 | size_t pad; |
@@ -378,7 +378,7 @@ nfs_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_symlinkargs *args) | |||
378 | * Encode arguments to readdir call | 378 | * Encode arguments to readdir call |
379 | */ | 379 | */ |
380 | static int | 380 | static int |
381 | nfs_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs_readdirargs *args) | 381 | nfs_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs_readdirargs *args) |
382 | { | 382 | { |
383 | struct rpc_task *task = req->rq_task; | 383 | struct rpc_task *task = req->rq_task; |
384 | struct rpc_auth *auth = task->tk_auth; | 384 | struct rpc_auth *auth = task->tk_auth; |
@@ -404,7 +404,7 @@ nfs_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs_readdirargs *args) | |||
404 | * from nfs_readdir for each entry. | 404 | * from nfs_readdir for each entry. |
405 | */ | 405 | */ |
406 | static int | 406 | static int |
407 | nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) | 407 | nfs_xdr_readdirres(struct rpc_rqst *req, __be32 *p, void *dummy) |
408 | { | 408 | { |
409 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | 409 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; |
410 | struct kvec *iov = rcvbuf->head; | 410 | struct kvec *iov = rcvbuf->head; |
@@ -412,7 +412,7 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) | |||
412 | int hdrlen, recvd; | 412 | int hdrlen, recvd; |
413 | int status, nr; | 413 | int status, nr; |
414 | unsigned int len, pglen; | 414 | unsigned int len, pglen; |
415 | u32 *end, *entry, *kaddr; | 415 | __be32 *end, *entry, *kaddr; |
416 | 416 | ||
417 | if ((status = ntohl(*p++))) | 417 | if ((status = ntohl(*p++))) |
418 | return -nfs_stat_to_errno(status); | 418 | return -nfs_stat_to_errno(status); |
@@ -432,8 +432,8 @@ nfs_xdr_readdirres(struct rpc_rqst *req, u32 *p, void *dummy) | |||
432 | if (pglen > recvd) | 432 | if (pglen > recvd) |
433 | pglen = recvd; | 433 | pglen = recvd; |
434 | page = rcvbuf->pages; | 434 | page = rcvbuf->pages; |
435 | kaddr = p = (u32 *)kmap_atomic(*page, KM_USER0); | 435 | kaddr = p = kmap_atomic(*page, KM_USER0); |
436 | end = (u32 *)((char *)p + pglen); | 436 | end = (__be32 *)((char *)p + pglen); |
437 | entry = p; | 437 | entry = p; |
438 | for (nr = 0; *p++; nr++) { | 438 | for (nr = 0; *p++; nr++) { |
439 | if (p + 2 > end) | 439 | if (p + 2 > end) |
@@ -468,8 +468,8 @@ err_unmap: | |||
468 | goto out; | 468 | goto out; |
469 | } | 469 | } |
470 | 470 | ||
471 | u32 * | 471 | __be32 * |
472 | nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | 472 | nfs_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
473 | { | 473 | { |
474 | if (!*p++) { | 474 | if (!*p++) { |
475 | if (!*p) | 475 | if (!*p) |
@@ -496,7 +496,7 @@ nfs_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | |||
496 | * Decode simple status reply | 496 | * Decode simple status reply |
497 | */ | 497 | */ |
498 | static int | 498 | static int |
499 | nfs_xdr_stat(struct rpc_rqst *req, u32 *p, void *dummy) | 499 | nfs_xdr_stat(struct rpc_rqst *req, __be32 *p, void *dummy) |
500 | { | 500 | { |
501 | int status; | 501 | int status; |
502 | 502 | ||
@@ -510,7 +510,7 @@ nfs_xdr_stat(struct rpc_rqst *req, u32 *p, void *dummy) | |||
510 | * GETATTR, SETATTR, WRITE | 510 | * GETATTR, SETATTR, WRITE |
511 | */ | 511 | */ |
512 | static int | 512 | static int |
513 | nfs_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | 513 | nfs_xdr_attrstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) |
514 | { | 514 | { |
515 | int status; | 515 | int status; |
516 | 516 | ||
@@ -525,7 +525,7 @@ nfs_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | |||
525 | * LOOKUP, CREATE, MKDIR | 525 | * LOOKUP, CREATE, MKDIR |
526 | */ | 526 | */ |
527 | static int | 527 | static int |
528 | nfs_xdr_diropres(struct rpc_rqst *req, u32 *p, struct nfs_diropok *res) | 528 | nfs_xdr_diropres(struct rpc_rqst *req, __be32 *p, struct nfs_diropok *res) |
529 | { | 529 | { |
530 | int status; | 530 | int status; |
531 | 531 | ||
@@ -540,7 +540,7 @@ nfs_xdr_diropres(struct rpc_rqst *req, u32 *p, struct nfs_diropok *res) | |||
540 | * Encode READLINK args | 540 | * Encode READLINK args |
541 | */ | 541 | */ |
542 | static int | 542 | static int |
543 | nfs_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_readlinkargs *args) | 543 | nfs_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs_readlinkargs *args) |
544 | { | 544 | { |
545 | struct rpc_auth *auth = req->rq_task->tk_auth; | 545 | struct rpc_auth *auth = req->rq_task->tk_auth; |
546 | unsigned int replen; | 546 | unsigned int replen; |
@@ -558,7 +558,7 @@ nfs_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs_readlinkargs *args | |||
558 | * Decode READLINK reply | 558 | * Decode READLINK reply |
559 | */ | 559 | */ |
560 | static int | 560 | static int |
561 | nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy) | 561 | nfs_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, void *dummy) |
562 | { | 562 | { |
563 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | 563 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; |
564 | struct kvec *iov = rcvbuf->head; | 564 | struct kvec *iov = rcvbuf->head; |
@@ -601,7 +601,7 @@ nfs_xdr_readlinkres(struct rpc_rqst *req, u32 *p, void *dummy) | |||
601 | * Decode WRITE reply | 601 | * Decode WRITE reply |
602 | */ | 602 | */ |
603 | static int | 603 | static int |
604 | nfs_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | 604 | nfs_xdr_writeres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res) |
605 | { | 605 | { |
606 | res->verf->committed = NFS_FILE_SYNC; | 606 | res->verf->committed = NFS_FILE_SYNC; |
607 | return nfs_xdr_attrstat(req, p, res->fattr); | 607 | return nfs_xdr_attrstat(req, p, res->fattr); |
@@ -611,7 +611,7 @@ nfs_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | |||
611 | * Decode STATFS reply | 611 | * Decode STATFS reply |
612 | */ | 612 | */ |
613 | static int | 613 | static int |
614 | nfs_xdr_statfsres(struct rpc_rqst *req, u32 *p, struct nfs2_fsstat *res) | 614 | nfs_xdr_statfsres(struct rpc_rqst *req, __be32 *p, struct nfs2_fsstat *res) |
615 | { | 615 | { |
616 | int status; | 616 | int status; |
617 | 617 | ||
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 3b234d4601..e5f128ffc3 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -668,7 +668,7 @@ nfs3_proc_readdir(struct dentry *dentry, struct rpc_cred *cred, | |||
668 | { | 668 | { |
669 | struct inode *dir = dentry->d_inode; | 669 | struct inode *dir = dentry->d_inode; |
670 | struct nfs_fattr dir_attr; | 670 | struct nfs_fattr dir_attr; |
671 | u32 *verf = NFS_COOKIEVERF(dir); | 671 | __be32 *verf = NFS_COOKIEVERF(dir); |
672 | struct nfs3_readdirargs arg = { | 672 | struct nfs3_readdirargs arg = { |
673 | .fh = NFS_FH(dir), | 673 | .fh = NFS_FH(dir), |
674 | .cookie = cookie, | 674 | .cookie = cookie, |
diff --git a/fs/nfs/nfs3xdr.c b/fs/nfs/nfs3xdr.c index 16556fa4ef..0ace092d12 100644 --- a/fs/nfs/nfs3xdr.c +++ b/fs/nfs/nfs3xdr.c | |||
@@ -105,14 +105,14 @@ static struct { | |||
105 | /* | 105 | /* |
106 | * Common NFS XDR functions as inlines | 106 | * Common NFS XDR functions as inlines |
107 | */ | 107 | */ |
108 | static inline u32 * | 108 | static inline __be32 * |
109 | xdr_encode_fhandle(u32 *p, struct nfs_fh *fh) | 109 | xdr_encode_fhandle(__be32 *p, struct nfs_fh *fh) |
110 | { | 110 | { |
111 | return xdr_encode_array(p, fh->data, fh->size); | 111 | return xdr_encode_array(p, fh->data, fh->size); |
112 | } | 112 | } |
113 | 113 | ||
114 | static inline u32 * | 114 | static inline __be32 * |
115 | xdr_decode_fhandle(u32 *p, struct nfs_fh *fh) | 115 | xdr_decode_fhandle(__be32 *p, struct nfs_fh *fh) |
116 | { | 116 | { |
117 | if ((fh->size = ntohl(*p++)) <= NFS3_FHSIZE) { | 117 | if ((fh->size = ntohl(*p++)) <= NFS3_FHSIZE) { |
118 | memcpy(fh->data, p, fh->size); | 118 | memcpy(fh->data, p, fh->size); |
@@ -124,24 +124,24 @@ xdr_decode_fhandle(u32 *p, struct nfs_fh *fh) | |||
124 | /* | 124 | /* |
125 | * Encode/decode time. | 125 | * Encode/decode time. |
126 | */ | 126 | */ |
127 | static inline u32 * | 127 | static inline __be32 * |
128 | xdr_encode_time3(u32 *p, struct timespec *timep) | 128 | xdr_encode_time3(__be32 *p, struct timespec *timep) |
129 | { | 129 | { |
130 | *p++ = htonl(timep->tv_sec); | 130 | *p++ = htonl(timep->tv_sec); |
131 | *p++ = htonl(timep->tv_nsec); | 131 | *p++ = htonl(timep->tv_nsec); |
132 | return p; | 132 | return p; |
133 | } | 133 | } |
134 | 134 | ||
135 | static inline u32 * | 135 | static inline __be32 * |
136 | xdr_decode_time3(u32 *p, struct timespec *timep) | 136 | xdr_decode_time3(__be32 *p, struct timespec *timep) |
137 | { | 137 | { |
138 | timep->tv_sec = ntohl(*p++); | 138 | timep->tv_sec = ntohl(*p++); |
139 | timep->tv_nsec = ntohl(*p++); | 139 | timep->tv_nsec = ntohl(*p++); |
140 | return p; | 140 | return p; |
141 | } | 141 | } |
142 | 142 | ||
143 | static u32 * | 143 | static __be32 * |
144 | xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) | 144 | xdr_decode_fattr(__be32 *p, struct nfs_fattr *fattr) |
145 | { | 145 | { |
146 | unsigned int type, major, minor; | 146 | unsigned int type, major, minor; |
147 | int fmode; | 147 | int fmode; |
@@ -177,8 +177,8 @@ xdr_decode_fattr(u32 *p, struct nfs_fattr *fattr) | |||
177 | return p; | 177 | return p; |
178 | } | 178 | } |
179 | 179 | ||
180 | static inline u32 * | 180 | static inline __be32 * |
181 | xdr_encode_sattr(u32 *p, struct iattr *attr) | 181 | xdr_encode_sattr(__be32 *p, struct iattr *attr) |
182 | { | 182 | { |
183 | if (attr->ia_valid & ATTR_MODE) { | 183 | if (attr->ia_valid & ATTR_MODE) { |
184 | *p++ = xdr_one; | 184 | *p++ = xdr_one; |
@@ -223,8 +223,8 @@ xdr_encode_sattr(u32 *p, struct iattr *attr) | |||
223 | return p; | 223 | return p; |
224 | } | 224 | } |
225 | 225 | ||
226 | static inline u32 * | 226 | static inline __be32 * |
227 | xdr_decode_wcc_attr(u32 *p, struct nfs_fattr *fattr) | 227 | xdr_decode_wcc_attr(__be32 *p, struct nfs_fattr *fattr) |
228 | { | 228 | { |
229 | p = xdr_decode_hyper(p, &fattr->pre_size); | 229 | p = xdr_decode_hyper(p, &fattr->pre_size); |
230 | p = xdr_decode_time3(p, &fattr->pre_mtime); | 230 | p = xdr_decode_time3(p, &fattr->pre_mtime); |
@@ -233,16 +233,16 @@ xdr_decode_wcc_attr(u32 *p, struct nfs_fattr *fattr) | |||
233 | return p; | 233 | return p; |
234 | } | 234 | } |
235 | 235 | ||
236 | static inline u32 * | 236 | static inline __be32 * |
237 | xdr_decode_post_op_attr(u32 *p, struct nfs_fattr *fattr) | 237 | xdr_decode_post_op_attr(__be32 *p, struct nfs_fattr *fattr) |
238 | { | 238 | { |
239 | if (*p++) | 239 | if (*p++) |
240 | p = xdr_decode_fattr(p, fattr); | 240 | p = xdr_decode_fattr(p, fattr); |
241 | return p; | 241 | return p; |
242 | } | 242 | } |
243 | 243 | ||
244 | static inline u32 * | 244 | static inline __be32 * |
245 | xdr_decode_pre_op_attr(u32 *p, struct nfs_fattr *fattr) | 245 | xdr_decode_pre_op_attr(__be32 *p, struct nfs_fattr *fattr) |
246 | { | 246 | { |
247 | if (*p++) | 247 | if (*p++) |
248 | return xdr_decode_wcc_attr(p, fattr); | 248 | return xdr_decode_wcc_attr(p, fattr); |
@@ -250,8 +250,8 @@ xdr_decode_pre_op_attr(u32 *p, struct nfs_fattr *fattr) | |||
250 | } | 250 | } |
251 | 251 | ||
252 | 252 | ||
253 | static inline u32 * | 253 | static inline __be32 * |
254 | xdr_decode_wcc_data(u32 *p, struct nfs_fattr *fattr) | 254 | xdr_decode_wcc_data(__be32 *p, struct nfs_fattr *fattr) |
255 | { | 255 | { |
256 | p = xdr_decode_pre_op_attr(p, fattr); | 256 | p = xdr_decode_pre_op_attr(p, fattr); |
257 | return xdr_decode_post_op_attr(p, fattr); | 257 | return xdr_decode_post_op_attr(p, fattr); |
@@ -265,7 +265,7 @@ xdr_decode_wcc_data(u32 *p, struct nfs_fattr *fattr) | |||
265 | * Encode file handle argument | 265 | * Encode file handle argument |
266 | */ | 266 | */ |
267 | static int | 267 | static int |
268 | nfs3_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh) | 268 | nfs3_xdr_fhandle(struct rpc_rqst *req, __be32 *p, struct nfs_fh *fh) |
269 | { | 269 | { |
270 | p = xdr_encode_fhandle(p, fh); | 270 | p = xdr_encode_fhandle(p, fh); |
271 | req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); | 271 | req->rq_slen = xdr_adjust_iovec(req->rq_svec, p); |
@@ -276,7 +276,7 @@ nfs3_xdr_fhandle(struct rpc_rqst *req, u32 *p, struct nfs_fh *fh) | |||
276 | * Encode SETATTR arguments | 276 | * Encode SETATTR arguments |
277 | */ | 277 | */ |
278 | static int | 278 | static int |
279 | nfs3_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs3_sattrargs *args) | 279 | nfs3_xdr_sattrargs(struct rpc_rqst *req, __be32 *p, struct nfs3_sattrargs *args) |
280 | { | 280 | { |
281 | p = xdr_encode_fhandle(p, args->fh); | 281 | p = xdr_encode_fhandle(p, args->fh); |
282 | p = xdr_encode_sattr(p, args->sattr); | 282 | p = xdr_encode_sattr(p, args->sattr); |
@@ -291,7 +291,7 @@ nfs3_xdr_sattrargs(struct rpc_rqst *req, u32 *p, struct nfs3_sattrargs *args) | |||
291 | * Encode directory ops argument | 291 | * Encode directory ops argument |
292 | */ | 292 | */ |
293 | static int | 293 | static int |
294 | nfs3_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs3_diropargs *args) | 294 | nfs3_xdr_diropargs(struct rpc_rqst *req, __be32 *p, struct nfs3_diropargs *args) |
295 | { | 295 | { |
296 | p = xdr_encode_fhandle(p, args->fh); | 296 | p = xdr_encode_fhandle(p, args->fh); |
297 | p = xdr_encode_array(p, args->name, args->len); | 297 | p = xdr_encode_array(p, args->name, args->len); |
@@ -303,7 +303,7 @@ nfs3_xdr_diropargs(struct rpc_rqst *req, u32 *p, struct nfs3_diropargs *args) | |||
303 | * Encode access() argument | 303 | * Encode access() argument |
304 | */ | 304 | */ |
305 | static int | 305 | static int |
306 | nfs3_xdr_accessargs(struct rpc_rqst *req, u32 *p, struct nfs3_accessargs *args) | 306 | nfs3_xdr_accessargs(struct rpc_rqst *req, __be32 *p, struct nfs3_accessargs *args) |
307 | { | 307 | { |
308 | p = xdr_encode_fhandle(p, args->fh); | 308 | p = xdr_encode_fhandle(p, args->fh); |
309 | *p++ = htonl(args->access); | 309 | *p++ = htonl(args->access); |
@@ -317,7 +317,7 @@ nfs3_xdr_accessargs(struct rpc_rqst *req, u32 *p, struct nfs3_accessargs *args) | |||
317 | * exactly to the page we want to fetch. | 317 | * exactly to the page we want to fetch. |
318 | */ | 318 | */ |
319 | static int | 319 | static int |
320 | nfs3_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args) | 320 | nfs3_xdr_readargs(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) |
321 | { | 321 | { |
322 | struct rpc_auth *auth = req->rq_task->tk_auth; | 322 | struct rpc_auth *auth = req->rq_task->tk_auth; |
323 | unsigned int replen; | 323 | unsigned int replen; |
@@ -339,7 +339,7 @@ nfs3_xdr_readargs(struct rpc_rqst *req, u32 *p, struct nfs_readargs *args) | |||
339 | * Write arguments. Splice the buffer to be written into the iovec. | 339 | * Write arguments. Splice the buffer to be written into the iovec. |
340 | */ | 340 | */ |
341 | static int | 341 | static int |
342 | nfs3_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | 342 | nfs3_xdr_writeargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) |
343 | { | 343 | { |
344 | struct xdr_buf *sndbuf = &req->rq_snd_buf; | 344 | struct xdr_buf *sndbuf = &req->rq_snd_buf; |
345 | u32 count = args->count; | 345 | u32 count = args->count; |
@@ -360,7 +360,7 @@ nfs3_xdr_writeargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | |||
360 | * Encode CREATE arguments | 360 | * Encode CREATE arguments |
361 | */ | 361 | */ |
362 | static int | 362 | static int |
363 | nfs3_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs3_createargs *args) | 363 | nfs3_xdr_createargs(struct rpc_rqst *req, __be32 *p, struct nfs3_createargs *args) |
364 | { | 364 | { |
365 | p = xdr_encode_fhandle(p, args->fh); | 365 | p = xdr_encode_fhandle(p, args->fh); |
366 | p = xdr_encode_array(p, args->name, args->len); | 366 | p = xdr_encode_array(p, args->name, args->len); |
@@ -380,7 +380,7 @@ nfs3_xdr_createargs(struct rpc_rqst *req, u32 *p, struct nfs3_createargs *args) | |||
380 | * Encode MKDIR arguments | 380 | * Encode MKDIR arguments |
381 | */ | 381 | */ |
382 | static int | 382 | static int |
383 | nfs3_xdr_mkdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_mkdirargs *args) | 383 | nfs3_xdr_mkdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_mkdirargs *args) |
384 | { | 384 | { |
385 | p = xdr_encode_fhandle(p, args->fh); | 385 | p = xdr_encode_fhandle(p, args->fh); |
386 | p = xdr_encode_array(p, args->name, args->len); | 386 | p = xdr_encode_array(p, args->name, args->len); |
@@ -393,7 +393,7 @@ nfs3_xdr_mkdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_mkdirargs *args) | |||
393 | * Encode SYMLINK arguments | 393 | * Encode SYMLINK arguments |
394 | */ | 394 | */ |
395 | static int | 395 | static int |
396 | nfs3_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_symlinkargs *args) | 396 | nfs3_xdr_symlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_symlinkargs *args) |
397 | { | 397 | { |
398 | p = xdr_encode_fhandle(p, args->fromfh); | 398 | p = xdr_encode_fhandle(p, args->fromfh); |
399 | p = xdr_encode_array(p, args->fromname, args->fromlen); | 399 | p = xdr_encode_array(p, args->fromname, args->fromlen); |
@@ -410,7 +410,7 @@ nfs3_xdr_symlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_symlinkargs *args | |||
410 | * Encode MKNOD arguments | 410 | * Encode MKNOD arguments |
411 | */ | 411 | */ |
412 | static int | 412 | static int |
413 | nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args) | 413 | nfs3_xdr_mknodargs(struct rpc_rqst *req, __be32 *p, struct nfs3_mknodargs *args) |
414 | { | 414 | { |
415 | p = xdr_encode_fhandle(p, args->fh); | 415 | p = xdr_encode_fhandle(p, args->fh); |
416 | p = xdr_encode_array(p, args->name, args->len); | 416 | p = xdr_encode_array(p, args->name, args->len); |
@@ -429,7 +429,7 @@ nfs3_xdr_mknodargs(struct rpc_rqst *req, u32 *p, struct nfs3_mknodargs *args) | |||
429 | * Encode RENAME arguments | 429 | * Encode RENAME arguments |
430 | */ | 430 | */ |
431 | static int | 431 | static int |
432 | nfs3_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs3_renameargs *args) | 432 | nfs3_xdr_renameargs(struct rpc_rqst *req, __be32 *p, struct nfs3_renameargs *args) |
433 | { | 433 | { |
434 | p = xdr_encode_fhandle(p, args->fromfh); | 434 | p = xdr_encode_fhandle(p, args->fromfh); |
435 | p = xdr_encode_array(p, args->fromname, args->fromlen); | 435 | p = xdr_encode_array(p, args->fromname, args->fromlen); |
@@ -443,7 +443,7 @@ nfs3_xdr_renameargs(struct rpc_rqst *req, u32 *p, struct nfs3_renameargs *args) | |||
443 | * Encode LINK arguments | 443 | * Encode LINK arguments |
444 | */ | 444 | */ |
445 | static int | 445 | static int |
446 | nfs3_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs3_linkargs *args) | 446 | nfs3_xdr_linkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_linkargs *args) |
447 | { | 447 | { |
448 | p = xdr_encode_fhandle(p, args->fromfh); | 448 | p = xdr_encode_fhandle(p, args->fromfh); |
449 | p = xdr_encode_fhandle(p, args->tofh); | 449 | p = xdr_encode_fhandle(p, args->tofh); |
@@ -456,7 +456,7 @@ nfs3_xdr_linkargs(struct rpc_rqst *req, u32 *p, struct nfs3_linkargs *args) | |||
456 | * Encode arguments to readdir call | 456 | * Encode arguments to readdir call |
457 | */ | 457 | */ |
458 | static int | 458 | static int |
459 | nfs3_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_readdirargs *args) | 459 | nfs3_xdr_readdirargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirargs *args) |
460 | { | 460 | { |
461 | struct rpc_auth *auth = req->rq_task->tk_auth; | 461 | struct rpc_auth *auth = req->rq_task->tk_auth; |
462 | unsigned int replen; | 462 | unsigned int replen; |
@@ -485,7 +485,7 @@ nfs3_xdr_readdirargs(struct rpc_rqst *req, u32 *p, struct nfs3_readdirargs *args | |||
485 | * We just check for syntactical correctness. | 485 | * We just check for syntactical correctness. |
486 | */ | 486 | */ |
487 | static int | 487 | static int |
488 | nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) | 488 | nfs3_xdr_readdirres(struct rpc_rqst *req, __be32 *p, struct nfs3_readdirres *res) |
489 | { | 489 | { |
490 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | 490 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; |
491 | struct kvec *iov = rcvbuf->head; | 491 | struct kvec *iov = rcvbuf->head; |
@@ -493,7 +493,7 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) | |||
493 | int hdrlen, recvd; | 493 | int hdrlen, recvd; |
494 | int status, nr; | 494 | int status, nr; |
495 | unsigned int len, pglen; | 495 | unsigned int len, pglen; |
496 | u32 *entry, *end, *kaddr; | 496 | __be32 *entry, *end, *kaddr; |
497 | 497 | ||
498 | status = ntohl(*p++); | 498 | status = ntohl(*p++); |
499 | /* Decode post_op_attrs */ | 499 | /* Decode post_op_attrs */ |
@@ -523,8 +523,8 @@ nfs3_xdr_readdirres(struct rpc_rqst *req, u32 *p, struct nfs3_readdirres *res) | |||
523 | if (pglen > recvd) | 523 | if (pglen > recvd) |
524 | pglen = recvd; | 524 | pglen = recvd; |
525 | page = rcvbuf->pages; | 525 | page = rcvbuf->pages; |
526 | kaddr = p = (u32 *)kmap_atomic(*page, KM_USER0); | 526 | kaddr = p = kmap_atomic(*page, KM_USER0); |
527 | end = (u32 *)((char *)p + pglen); | 527 | end = (__be32 *)((char *)p + pglen); |
528 | entry = p; | 528 | entry = p; |
529 | for (nr = 0; *p++; nr++) { | 529 | for (nr = 0; *p++; nr++) { |
530 | if (p + 3 > end) | 530 | if (p + 3 > end) |
@@ -583,8 +583,8 @@ err_unmap: | |||
583 | goto out; | 583 | goto out; |
584 | } | 584 | } |
585 | 585 | ||
586 | u32 * | 586 | __be32 * |
587 | nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | 587 | nfs3_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
588 | { | 588 | { |
589 | struct nfs_entry old = *entry; | 589 | struct nfs_entry old = *entry; |
590 | 590 | ||
@@ -626,7 +626,7 @@ nfs3_decode_dirent(u32 *p, struct nfs_entry *entry, int plus) | |||
626 | * Encode COMMIT arguments | 626 | * Encode COMMIT arguments |
627 | */ | 627 | */ |
628 | static int | 628 | static int |
629 | nfs3_xdr_commitargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | 629 | nfs3_xdr_commitargs(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) |
630 | { | 630 | { |
631 | p = xdr_encode_fhandle(p, args->fh); | 631 | p = xdr_encode_fhandle(p, args->fh); |
632 | p = xdr_encode_hyper(p, args->offset); | 632 | p = xdr_encode_hyper(p, args->offset); |
@@ -640,7 +640,7 @@ nfs3_xdr_commitargs(struct rpc_rqst *req, u32 *p, struct nfs_writeargs *args) | |||
640 | * Encode GETACL arguments | 640 | * Encode GETACL arguments |
641 | */ | 641 | */ |
642 | static int | 642 | static int |
643 | nfs3_xdr_getaclargs(struct rpc_rqst *req, u32 *p, | 643 | nfs3_xdr_getaclargs(struct rpc_rqst *req, __be32 *p, |
644 | struct nfs3_getaclargs *args) | 644 | struct nfs3_getaclargs *args) |
645 | { | 645 | { |
646 | struct rpc_auth *auth = req->rq_task->tk_auth; | 646 | struct rpc_auth *auth = req->rq_task->tk_auth; |
@@ -664,7 +664,7 @@ nfs3_xdr_getaclargs(struct rpc_rqst *req, u32 *p, | |||
664 | * Encode SETACL arguments | 664 | * Encode SETACL arguments |
665 | */ | 665 | */ |
666 | static int | 666 | static int |
667 | nfs3_xdr_setaclargs(struct rpc_rqst *req, u32 *p, | 667 | nfs3_xdr_setaclargs(struct rpc_rqst *req, __be32 *p, |
668 | struct nfs3_setaclargs *args) | 668 | struct nfs3_setaclargs *args) |
669 | { | 669 | { |
670 | struct xdr_buf *buf = &req->rq_snd_buf; | 670 | struct xdr_buf *buf = &req->rq_snd_buf; |
@@ -711,7 +711,7 @@ nfs3_xdr_setaclargs(struct rpc_rqst *req, u32 *p, | |||
711 | * Decode attrstat reply. | 711 | * Decode attrstat reply. |
712 | */ | 712 | */ |
713 | static int | 713 | static int |
714 | nfs3_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | 714 | nfs3_xdr_attrstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) |
715 | { | 715 | { |
716 | int status; | 716 | int status; |
717 | 717 | ||
@@ -726,7 +726,7 @@ nfs3_xdr_attrstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | |||
726 | * SATTR, REMOVE, RMDIR | 726 | * SATTR, REMOVE, RMDIR |
727 | */ | 727 | */ |
728 | static int | 728 | static int |
729 | nfs3_xdr_wccstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | 729 | nfs3_xdr_wccstat(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) |
730 | { | 730 | { |
731 | int status; | 731 | int status; |
732 | 732 | ||
@@ -740,7 +740,7 @@ nfs3_xdr_wccstat(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | |||
740 | * Decode LOOKUP reply | 740 | * Decode LOOKUP reply |
741 | */ | 741 | */ |
742 | static int | 742 | static int |
743 | nfs3_xdr_lookupres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res) | 743 | nfs3_xdr_lookupres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res) |
744 | { | 744 | { |
745 | int status; | 745 | int status; |
746 | 746 | ||
@@ -759,7 +759,7 @@ nfs3_xdr_lookupres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res) | |||
759 | * Decode ACCESS reply | 759 | * Decode ACCESS reply |
760 | */ | 760 | */ |
761 | static int | 761 | static int |
762 | nfs3_xdr_accessres(struct rpc_rqst *req, u32 *p, struct nfs3_accessres *res) | 762 | nfs3_xdr_accessres(struct rpc_rqst *req, __be32 *p, struct nfs3_accessres *res) |
763 | { | 763 | { |
764 | int status = ntohl(*p++); | 764 | int status = ntohl(*p++); |
765 | 765 | ||
@@ -771,7 +771,7 @@ nfs3_xdr_accessres(struct rpc_rqst *req, u32 *p, struct nfs3_accessres *res) | |||
771 | } | 771 | } |
772 | 772 | ||
773 | static int | 773 | static int |
774 | nfs3_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_readlinkargs *args) | 774 | nfs3_xdr_readlinkargs(struct rpc_rqst *req, __be32 *p, struct nfs3_readlinkargs *args) |
775 | { | 775 | { |
776 | struct rpc_auth *auth = req->rq_task->tk_auth; | 776 | struct rpc_auth *auth = req->rq_task->tk_auth; |
777 | unsigned int replen; | 777 | unsigned int replen; |
@@ -789,7 +789,7 @@ nfs3_xdr_readlinkargs(struct rpc_rqst *req, u32 *p, struct nfs3_readlinkargs *ar | |||
789 | * Decode READLINK reply | 789 | * Decode READLINK reply |
790 | */ | 790 | */ |
791 | static int | 791 | static int |
792 | nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | 792 | nfs3_xdr_readlinkres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) |
793 | { | 793 | { |
794 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | 794 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; |
795 | struct kvec *iov = rcvbuf->head; | 795 | struct kvec *iov = rcvbuf->head; |
@@ -837,7 +837,7 @@ nfs3_xdr_readlinkres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | |||
837 | * Decode READ reply | 837 | * Decode READ reply |
838 | */ | 838 | */ |
839 | static int | 839 | static int |
840 | nfs3_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res) | 840 | nfs3_xdr_readres(struct rpc_rqst *req, __be32 *p, struct nfs_readres *res) |
841 | { | 841 | { |
842 | struct kvec *iov = req->rq_rcv_buf.head; | 842 | struct kvec *iov = req->rq_rcv_buf.head; |
843 | int status, count, ocount, recvd, hdrlen; | 843 | int status, count, ocount, recvd, hdrlen; |
@@ -888,7 +888,7 @@ nfs3_xdr_readres(struct rpc_rqst *req, u32 *p, struct nfs_readres *res) | |||
888 | * Decode WRITE response | 888 | * Decode WRITE response |
889 | */ | 889 | */ |
890 | static int | 890 | static int |
891 | nfs3_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | 891 | nfs3_xdr_writeres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res) |
892 | { | 892 | { |
893 | int status; | 893 | int status; |
894 | 894 | ||
@@ -910,7 +910,7 @@ nfs3_xdr_writeres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | |||
910 | * Decode a CREATE response | 910 | * Decode a CREATE response |
911 | */ | 911 | */ |
912 | static int | 912 | static int |
913 | nfs3_xdr_createres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res) | 913 | nfs3_xdr_createres(struct rpc_rqst *req, __be32 *p, struct nfs3_diropres *res) |
914 | { | 914 | { |
915 | int status; | 915 | int status; |
916 | 916 | ||
@@ -937,7 +937,7 @@ nfs3_xdr_createres(struct rpc_rqst *req, u32 *p, struct nfs3_diropres *res) | |||
937 | * Decode RENAME reply | 937 | * Decode RENAME reply |
938 | */ | 938 | */ |
939 | static int | 939 | static int |
940 | nfs3_xdr_renameres(struct rpc_rqst *req, u32 *p, struct nfs3_renameres *res) | 940 | nfs3_xdr_renameres(struct rpc_rqst *req, __be32 *p, struct nfs3_renameres *res) |
941 | { | 941 | { |
942 | int status; | 942 | int status; |
943 | 943 | ||
@@ -952,7 +952,7 @@ nfs3_xdr_renameres(struct rpc_rqst *req, u32 *p, struct nfs3_renameres *res) | |||
952 | * Decode LINK reply | 952 | * Decode LINK reply |
953 | */ | 953 | */ |
954 | static int | 954 | static int |
955 | nfs3_xdr_linkres(struct rpc_rqst *req, u32 *p, struct nfs3_linkres *res) | 955 | nfs3_xdr_linkres(struct rpc_rqst *req, __be32 *p, struct nfs3_linkres *res) |
956 | { | 956 | { |
957 | int status; | 957 | int status; |
958 | 958 | ||
@@ -967,7 +967,7 @@ nfs3_xdr_linkres(struct rpc_rqst *req, u32 *p, struct nfs3_linkres *res) | |||
967 | * Decode FSSTAT reply | 967 | * Decode FSSTAT reply |
968 | */ | 968 | */ |
969 | static int | 969 | static int |
970 | nfs3_xdr_fsstatres(struct rpc_rqst *req, u32 *p, struct nfs_fsstat *res) | 970 | nfs3_xdr_fsstatres(struct rpc_rqst *req, __be32 *p, struct nfs_fsstat *res) |
971 | { | 971 | { |
972 | int status; | 972 | int status; |
973 | 973 | ||
@@ -992,7 +992,7 @@ nfs3_xdr_fsstatres(struct rpc_rqst *req, u32 *p, struct nfs_fsstat *res) | |||
992 | * Decode FSINFO reply | 992 | * Decode FSINFO reply |
993 | */ | 993 | */ |
994 | static int | 994 | static int |
995 | nfs3_xdr_fsinfores(struct rpc_rqst *req, u32 *p, struct nfs_fsinfo *res) | 995 | nfs3_xdr_fsinfores(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *res) |
996 | { | 996 | { |
997 | int status; | 997 | int status; |
998 | 998 | ||
@@ -1020,7 +1020,7 @@ nfs3_xdr_fsinfores(struct rpc_rqst *req, u32 *p, struct nfs_fsinfo *res) | |||
1020 | * Decode PATHCONF reply | 1020 | * Decode PATHCONF reply |
1021 | */ | 1021 | */ |
1022 | static int | 1022 | static int |
1023 | nfs3_xdr_pathconfres(struct rpc_rqst *req, u32 *p, struct nfs_pathconf *res) | 1023 | nfs3_xdr_pathconfres(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *res) |
1024 | { | 1024 | { |
1025 | int status; | 1025 | int status; |
1026 | 1026 | ||
@@ -1040,7 +1040,7 @@ nfs3_xdr_pathconfres(struct rpc_rqst *req, u32 *p, struct nfs_pathconf *res) | |||
1040 | * Decode COMMIT reply | 1040 | * Decode COMMIT reply |
1041 | */ | 1041 | */ |
1042 | static int | 1042 | static int |
1043 | nfs3_xdr_commitres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | 1043 | nfs3_xdr_commitres(struct rpc_rqst *req, __be32 *p, struct nfs_writeres *res) |
1044 | { | 1044 | { |
1045 | int status; | 1045 | int status; |
1046 | 1046 | ||
@@ -1059,7 +1059,7 @@ nfs3_xdr_commitres(struct rpc_rqst *req, u32 *p, struct nfs_writeres *res) | |||
1059 | * Decode GETACL reply | 1059 | * Decode GETACL reply |
1060 | */ | 1060 | */ |
1061 | static int | 1061 | static int |
1062 | nfs3_xdr_getaclres(struct rpc_rqst *req, u32 *p, | 1062 | nfs3_xdr_getaclres(struct rpc_rqst *req, __be32 *p, |
1063 | struct nfs3_getaclres *res) | 1063 | struct nfs3_getaclres *res) |
1064 | { | 1064 | { |
1065 | struct xdr_buf *buf = &req->rq_rcv_buf; | 1065 | struct xdr_buf *buf = &req->rq_rcv_buf; |
@@ -1091,7 +1091,7 @@ nfs3_xdr_getaclres(struct rpc_rqst *req, u32 *p, | |||
1091 | * Decode setacl reply. | 1091 | * Decode setacl reply. |
1092 | */ | 1092 | */ |
1093 | static int | 1093 | static int |
1094 | nfs3_xdr_setaclres(struct rpc_rqst *req, u32 *p, struct nfs_fattr *fattr) | 1094 | nfs3_xdr_setaclres(struct rpc_rqst *req, __be32 *p, struct nfs_fattr *fattr) |
1095 | { | 1095 | { |
1096 | int status = ntohl(*p++); | 1096 | int status = ntohl(*p++); |
1097 | 1097 | ||
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 61095fe4b5..6f34667733 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h | |||
@@ -212,7 +212,7 @@ extern void nfs_free_seqid(struct nfs_seqid *seqid); | |||
212 | extern const nfs4_stateid zero_stateid; | 212 | extern const nfs4_stateid zero_stateid; |
213 | 213 | ||
214 | /* nfs4xdr.c */ | 214 | /* nfs4xdr.c */ |
215 | extern uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus); | 215 | extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus); |
216 | extern struct rpc_procinfo nfs4_procedures[]; | 216 | extern struct rpc_procinfo nfs4_procedures[]; |
217 | 217 | ||
218 | struct nfs4_mount_data; | 218 | struct nfs4_mount_data; |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 47c7e6e391..8118036cc4 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -138,10 +138,10 @@ const u32 nfs4_fs_locations_bitmap[2] = { | |||
138 | | FATTR4_WORD1_MOUNTED_ON_FILEID | 138 | | FATTR4_WORD1_MOUNTED_ON_FILEID |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, | 141 | static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dentry, |
142 | struct nfs4_readdir_arg *readdir) | 142 | struct nfs4_readdir_arg *readdir) |
143 | { | 143 | { |
144 | u32 *start, *p; | 144 | __be32 *start, *p; |
145 | 145 | ||
146 | BUG_ON(readdir->count < 80); | 146 | BUG_ON(readdir->count < 80); |
147 | if (cookie > 2) { | 147 | if (cookie > 2) { |
@@ -162,7 +162,7 @@ static void nfs4_setup_readdir(u64 cookie, u32 *verifier, struct dentry *dentry, | |||
162 | * when talking to the server, we always send cookie 0 | 162 | * when talking to the server, we always send cookie 0 |
163 | * instead of 1 or 2. | 163 | * instead of 1 or 2. |
164 | */ | 164 | */ |
165 | start = p = (u32 *)kmap_atomic(*readdir->pages, KM_USER0); | 165 | start = p = kmap_atomic(*readdir->pages, KM_USER0); |
166 | 166 | ||
167 | if (cookie == 0) { | 167 | if (cookie == 0) { |
168 | *p++ = xdr_one; /* next */ | 168 | *p++ = xdr_one; /* next */ |
@@ -1314,11 +1314,9 @@ nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, st | |||
1314 | case -EROFS: | 1314 | case -EROFS: |
1315 | lookup_instantiate_filp(nd, (struct dentry *)state, NULL); | 1315 | lookup_instantiate_filp(nd, (struct dentry *)state, NULL); |
1316 | return 1; | 1316 | return 1; |
1317 | case -ENOENT: | 1317 | default: |
1318 | if (dentry->d_inode == NULL) | 1318 | goto out_drop; |
1319 | return 1; | ||
1320 | } | 1319 | } |
1321 | goto out_drop; | ||
1322 | } | 1320 | } |
1323 | if (state->inode == dentry->d_inode) { | 1321 | if (state->inode == dentry->d_inode) { |
1324 | nfs4_intent_set_file(nd, dentry, state); | 1322 | nfs4_intent_set_file(nd, dentry, state); |
@@ -2917,11 +2915,11 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short po | |||
2917 | .rpc_resp = clp, | 2915 | .rpc_resp = clp, |
2918 | .rpc_cred = cred, | 2916 | .rpc_cred = cred, |
2919 | }; | 2917 | }; |
2920 | u32 *p; | 2918 | __be32 *p; |
2921 | int loop = 0; | 2919 | int loop = 0; |
2922 | int status; | 2920 | int status; |
2923 | 2921 | ||
2924 | p = (u32*)sc_verifier.data; | 2922 | p = (__be32*)sc_verifier.data; |
2925 | *p++ = htonl((u32)clp->cl_boot_time.tv_sec); | 2923 | *p++ = htonl((u32)clp->cl_boot_time.tv_sec); |
2926 | *p = htonl((u32)clp->cl_boot_time.tv_nsec); | 2924 | *p = htonl((u32)clp->cl_boot_time.tv_nsec); |
2927 | 2925 | ||
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 3dd413f52d..0cf3fa312a 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -471,7 +471,7 @@ struct compound_hdr { | |||
471 | 471 | ||
472 | static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) | 472 | static void encode_string(struct xdr_stream *xdr, unsigned int len, const char *str) |
473 | { | 473 | { |
474 | uint32_t *p; | 474 | __be32 *p; |
475 | 475 | ||
476 | p = xdr_reserve_space(xdr, 4 + len); | 476 | p = xdr_reserve_space(xdr, 4 + len); |
477 | BUG_ON(p == NULL); | 477 | BUG_ON(p == NULL); |
@@ -480,7 +480,7 @@ static void encode_string(struct xdr_stream *xdr, unsigned int len, const char * | |||
480 | 480 | ||
481 | static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) | 481 | static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) |
482 | { | 482 | { |
483 | uint32_t *p; | 483 | __be32 *p; |
484 | 484 | ||
485 | dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag); | 485 | dprintk("encode_compound: tag=%.*s\n", (int)hdr->taglen, hdr->tag); |
486 | BUG_ON(hdr->taglen > NFS4_MAXTAGLEN); | 486 | BUG_ON(hdr->taglen > NFS4_MAXTAGLEN); |
@@ -494,7 +494,7 @@ static int encode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
494 | 494 | ||
495 | static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf) | 495 | static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *verf) |
496 | { | 496 | { |
497 | uint32_t *p; | 497 | __be32 *p; |
498 | 498 | ||
499 | p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE); | 499 | p = xdr_reserve_space(xdr, NFS4_VERIFIER_SIZE); |
500 | BUG_ON(p == NULL); | 500 | BUG_ON(p == NULL); |
@@ -507,8 +507,8 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
507 | char owner_group[IDMAP_NAMESZ]; | 507 | char owner_group[IDMAP_NAMESZ]; |
508 | int owner_namelen = 0; | 508 | int owner_namelen = 0; |
509 | int owner_grouplen = 0; | 509 | int owner_grouplen = 0; |
510 | uint32_t *p; | 510 | __be32 *p; |
511 | uint32_t *q; | 511 | __be32 *q; |
512 | int len; | 512 | int len; |
513 | uint32_t bmval0 = 0; | 513 | uint32_t bmval0 = 0; |
514 | uint32_t bmval1 = 0; | 514 | uint32_t bmval1 = 0; |
@@ -630,7 +630,7 @@ static int encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const s | |||
630 | 630 | ||
631 | static int encode_access(struct xdr_stream *xdr, u32 access) | 631 | static int encode_access(struct xdr_stream *xdr, u32 access) |
632 | { | 632 | { |
633 | uint32_t *p; | 633 | __be32 *p; |
634 | 634 | ||
635 | RESERVE_SPACE(8); | 635 | RESERVE_SPACE(8); |
636 | WRITE32(OP_ACCESS); | 636 | WRITE32(OP_ACCESS); |
@@ -641,7 +641,7 @@ static int encode_access(struct xdr_stream *xdr, u32 access) | |||
641 | 641 | ||
642 | static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg) | 642 | static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg) |
643 | { | 643 | { |
644 | uint32_t *p; | 644 | __be32 *p; |
645 | 645 | ||
646 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); | 646 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); |
647 | WRITE32(OP_CLOSE); | 647 | WRITE32(OP_CLOSE); |
@@ -653,7 +653,7 @@ static int encode_close(struct xdr_stream *xdr, const struct nfs_closeargs *arg) | |||
653 | 653 | ||
654 | static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args) | 654 | static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *args) |
655 | { | 655 | { |
656 | uint32_t *p; | 656 | __be32 *p; |
657 | 657 | ||
658 | RESERVE_SPACE(16); | 658 | RESERVE_SPACE(16); |
659 | WRITE32(OP_COMMIT); | 659 | WRITE32(OP_COMMIT); |
@@ -665,7 +665,7 @@ static int encode_commit(struct xdr_stream *xdr, const struct nfs_writeargs *arg | |||
665 | 665 | ||
666 | static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create) | 666 | static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *create) |
667 | { | 667 | { |
668 | uint32_t *p; | 668 | __be32 *p; |
669 | 669 | ||
670 | RESERVE_SPACE(8); | 670 | RESERVE_SPACE(8); |
671 | WRITE32(OP_CREATE); | 671 | WRITE32(OP_CREATE); |
@@ -697,7 +697,7 @@ static int encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *c | |||
697 | 697 | ||
698 | static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap) | 698 | static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap) |
699 | { | 699 | { |
700 | uint32_t *p; | 700 | __be32 *p; |
701 | 701 | ||
702 | RESERVE_SPACE(12); | 702 | RESERVE_SPACE(12); |
703 | WRITE32(OP_GETATTR); | 703 | WRITE32(OP_GETATTR); |
@@ -708,7 +708,7 @@ static int encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap) | |||
708 | 708 | ||
709 | static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1) | 709 | static int encode_getattr_two(struct xdr_stream *xdr, uint32_t bm0, uint32_t bm1) |
710 | { | 710 | { |
711 | uint32_t *p; | 711 | __be32 *p; |
712 | 712 | ||
713 | RESERVE_SPACE(16); | 713 | RESERVE_SPACE(16); |
714 | WRITE32(OP_GETATTR); | 714 | WRITE32(OP_GETATTR); |
@@ -740,7 +740,7 @@ static int encode_fs_locations(struct xdr_stream *xdr, const u32* bitmask) | |||
740 | 740 | ||
741 | static int encode_getfh(struct xdr_stream *xdr) | 741 | static int encode_getfh(struct xdr_stream *xdr) |
742 | { | 742 | { |
743 | uint32_t *p; | 743 | __be32 *p; |
744 | 744 | ||
745 | RESERVE_SPACE(4); | 745 | RESERVE_SPACE(4); |
746 | WRITE32(OP_GETFH); | 746 | WRITE32(OP_GETFH); |
@@ -750,7 +750,7 @@ static int encode_getfh(struct xdr_stream *xdr) | |||
750 | 750 | ||
751 | static int encode_link(struct xdr_stream *xdr, const struct qstr *name) | 751 | static int encode_link(struct xdr_stream *xdr, const struct qstr *name) |
752 | { | 752 | { |
753 | uint32_t *p; | 753 | __be32 *p; |
754 | 754 | ||
755 | RESERVE_SPACE(8 + name->len); | 755 | RESERVE_SPACE(8 + name->len); |
756 | WRITE32(OP_LINK); | 756 | WRITE32(OP_LINK); |
@@ -780,7 +780,7 @@ static inline uint64_t nfs4_lock_length(struct file_lock *fl) | |||
780 | */ | 780 | */ |
781 | static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args) | 781 | static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args) |
782 | { | 782 | { |
783 | uint32_t *p; | 783 | __be32 *p; |
784 | 784 | ||
785 | RESERVE_SPACE(32); | 785 | RESERVE_SPACE(32); |
786 | WRITE32(OP_LOCK); | 786 | WRITE32(OP_LOCK); |
@@ -809,7 +809,7 @@ static int encode_lock(struct xdr_stream *xdr, const struct nfs_lock_args *args) | |||
809 | 809 | ||
810 | static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args) | 810 | static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *args) |
811 | { | 811 | { |
812 | uint32_t *p; | 812 | __be32 *p; |
813 | 813 | ||
814 | RESERVE_SPACE(40); | 814 | RESERVE_SPACE(40); |
815 | WRITE32(OP_LOCKT); | 815 | WRITE32(OP_LOCKT); |
@@ -825,7 +825,7 @@ static int encode_lockt(struct xdr_stream *xdr, const struct nfs_lockt_args *arg | |||
825 | 825 | ||
826 | static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args) | 826 | static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *args) |
827 | { | 827 | { |
828 | uint32_t *p; | 828 | __be32 *p; |
829 | 829 | ||
830 | RESERVE_SPACE(44); | 830 | RESERVE_SPACE(44); |
831 | WRITE32(OP_LOCKU); | 831 | WRITE32(OP_LOCKU); |
@@ -841,7 +841,7 @@ static int encode_locku(struct xdr_stream *xdr, const struct nfs_locku_args *arg | |||
841 | static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name) | 841 | static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name) |
842 | { | 842 | { |
843 | int len = name->len; | 843 | int len = name->len; |
844 | uint32_t *p; | 844 | __be32 *p; |
845 | 845 | ||
846 | RESERVE_SPACE(8 + len); | 846 | RESERVE_SPACE(8 + len); |
847 | WRITE32(OP_LOOKUP); | 847 | WRITE32(OP_LOOKUP); |
@@ -853,7 +853,7 @@ static int encode_lookup(struct xdr_stream *xdr, const struct qstr *name) | |||
853 | 853 | ||
854 | static void encode_share_access(struct xdr_stream *xdr, int open_flags) | 854 | static void encode_share_access(struct xdr_stream *xdr, int open_flags) |
855 | { | 855 | { |
856 | uint32_t *p; | 856 | __be32 *p; |
857 | 857 | ||
858 | RESERVE_SPACE(8); | 858 | RESERVE_SPACE(8); |
859 | switch (open_flags & (FMODE_READ|FMODE_WRITE)) { | 859 | switch (open_flags & (FMODE_READ|FMODE_WRITE)) { |
@@ -874,7 +874,7 @@ static void encode_share_access(struct xdr_stream *xdr, int open_flags) | |||
874 | 874 | ||
875 | static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg) | 875 | static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_openargs *arg) |
876 | { | 876 | { |
877 | uint32_t *p; | 877 | __be32 *p; |
878 | /* | 878 | /* |
879 | * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, | 879 | * opcode 4, seqid 4, share_access 4, share_deny 4, clientid 8, ownerlen 4, |
880 | * owner 4 = 32 | 880 | * owner 4 = 32 |
@@ -891,7 +891,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena | |||
891 | 891 | ||
892 | static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg) | 892 | static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg) |
893 | { | 893 | { |
894 | uint32_t *p; | 894 | __be32 *p; |
895 | 895 | ||
896 | RESERVE_SPACE(4); | 896 | RESERVE_SPACE(4); |
897 | switch(arg->open_flags & O_EXCL) { | 897 | switch(arg->open_flags & O_EXCL) { |
@@ -907,7 +907,7 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op | |||
907 | 907 | ||
908 | static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *arg) | 908 | static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *arg) |
909 | { | 909 | { |
910 | uint32_t *p; | 910 | __be32 *p; |
911 | 911 | ||
912 | RESERVE_SPACE(4); | 912 | RESERVE_SPACE(4); |
913 | switch (arg->open_flags & O_CREAT) { | 913 | switch (arg->open_flags & O_CREAT) { |
@@ -923,7 +923,7 @@ static void encode_opentype(struct xdr_stream *xdr, const struct nfs_openargs *a | |||
923 | 923 | ||
924 | static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation_type) | 924 | static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation_type) |
925 | { | 925 | { |
926 | uint32_t *p; | 926 | __be32 *p; |
927 | 927 | ||
928 | RESERVE_SPACE(4); | 928 | RESERVE_SPACE(4); |
929 | switch (delegation_type) { | 929 | switch (delegation_type) { |
@@ -943,7 +943,7 @@ static inline void encode_delegation_type(struct xdr_stream *xdr, int delegation | |||
943 | 943 | ||
944 | static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr *name) | 944 | static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr *name) |
945 | { | 945 | { |
946 | uint32_t *p; | 946 | __be32 *p; |
947 | 947 | ||
948 | RESERVE_SPACE(4); | 948 | RESERVE_SPACE(4); |
949 | WRITE32(NFS4_OPEN_CLAIM_NULL); | 949 | WRITE32(NFS4_OPEN_CLAIM_NULL); |
@@ -952,7 +952,7 @@ static inline void encode_claim_null(struct xdr_stream *xdr, const struct qstr * | |||
952 | 952 | ||
953 | static inline void encode_claim_previous(struct xdr_stream *xdr, int type) | 953 | static inline void encode_claim_previous(struct xdr_stream *xdr, int type) |
954 | { | 954 | { |
955 | uint32_t *p; | 955 | __be32 *p; |
956 | 956 | ||
957 | RESERVE_SPACE(4); | 957 | RESERVE_SPACE(4); |
958 | WRITE32(NFS4_OPEN_CLAIM_PREVIOUS); | 958 | WRITE32(NFS4_OPEN_CLAIM_PREVIOUS); |
@@ -961,7 +961,7 @@ static inline void encode_claim_previous(struct xdr_stream *xdr, int type) | |||
961 | 961 | ||
962 | static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struct qstr *name, const nfs4_stateid *stateid) | 962 | static inline void encode_claim_delegate_cur(struct xdr_stream *xdr, const struct qstr *name, const nfs4_stateid *stateid) |
963 | { | 963 | { |
964 | uint32_t *p; | 964 | __be32 *p; |
965 | 965 | ||
966 | RESERVE_SPACE(4+sizeof(stateid->data)); | 966 | RESERVE_SPACE(4+sizeof(stateid->data)); |
967 | WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR); | 967 | WRITE32(NFS4_OPEN_CLAIM_DELEGATE_CUR); |
@@ -991,7 +991,7 @@ static int encode_open(struct xdr_stream *xdr, const struct nfs_openargs *arg) | |||
991 | 991 | ||
992 | static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg) | 992 | static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_confirmargs *arg) |
993 | { | 993 | { |
994 | uint32_t *p; | 994 | __be32 *p; |
995 | 995 | ||
996 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); | 996 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); |
997 | WRITE32(OP_OPEN_CONFIRM); | 997 | WRITE32(OP_OPEN_CONFIRM); |
@@ -1003,7 +1003,7 @@ static int encode_open_confirm(struct xdr_stream *xdr, const struct nfs_open_con | |||
1003 | 1003 | ||
1004 | static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg) | 1004 | static int encode_open_downgrade(struct xdr_stream *xdr, const struct nfs_closeargs *arg) |
1005 | { | 1005 | { |
1006 | uint32_t *p; | 1006 | __be32 *p; |
1007 | 1007 | ||
1008 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); | 1008 | RESERVE_SPACE(8+sizeof(arg->stateid->data)); |
1009 | WRITE32(OP_OPEN_DOWNGRADE); | 1009 | WRITE32(OP_OPEN_DOWNGRADE); |
@@ -1017,7 +1017,7 @@ static int | |||
1017 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh) | 1017 | encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh) |
1018 | { | 1018 | { |
1019 | int len = fh->size; | 1019 | int len = fh->size; |
1020 | uint32_t *p; | 1020 | __be32 *p; |
1021 | 1021 | ||
1022 | RESERVE_SPACE(8 + len); | 1022 | RESERVE_SPACE(8 + len); |
1023 | WRITE32(OP_PUTFH); | 1023 | WRITE32(OP_PUTFH); |
@@ -1029,7 +1029,7 @@ encode_putfh(struct xdr_stream *xdr, const struct nfs_fh *fh) | |||
1029 | 1029 | ||
1030 | static int encode_putrootfh(struct xdr_stream *xdr) | 1030 | static int encode_putrootfh(struct xdr_stream *xdr) |
1031 | { | 1031 | { |
1032 | uint32_t *p; | 1032 | __be32 *p; |
1033 | 1033 | ||
1034 | RESERVE_SPACE(4); | 1034 | RESERVE_SPACE(4); |
1035 | WRITE32(OP_PUTROOTFH); | 1035 | WRITE32(OP_PUTROOTFH); |
@@ -1040,7 +1040,7 @@ static int encode_putrootfh(struct xdr_stream *xdr) | |||
1040 | static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx) | 1040 | static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context *ctx) |
1041 | { | 1041 | { |
1042 | nfs4_stateid stateid; | 1042 | nfs4_stateid stateid; |
1043 | uint32_t *p; | 1043 | __be32 *p; |
1044 | 1044 | ||
1045 | RESERVE_SPACE(16); | 1045 | RESERVE_SPACE(16); |
1046 | if (ctx->state != NULL) { | 1046 | if (ctx->state != NULL) { |
@@ -1052,7 +1052,7 @@ static void encode_stateid(struct xdr_stream *xdr, const struct nfs_open_context | |||
1052 | 1052 | ||
1053 | static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) | 1053 | static int encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args) |
1054 | { | 1054 | { |
1055 | uint32_t *p; | 1055 | __be32 *p; |
1056 | 1056 | ||
1057 | RESERVE_SPACE(4); | 1057 | RESERVE_SPACE(4); |
1058 | WRITE32(OP_READ); | 1058 | WRITE32(OP_READ); |
@@ -1074,7 +1074,7 @@ static int encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg | |||
1074 | FATTR4_WORD1_MOUNTED_ON_FILEID, | 1074 | FATTR4_WORD1_MOUNTED_ON_FILEID, |
1075 | }; | 1075 | }; |
1076 | int replen; | 1076 | int replen; |
1077 | uint32_t *p; | 1077 | __be32 *p; |
1078 | 1078 | ||
1079 | RESERVE_SPACE(32+sizeof(nfs4_verifier)); | 1079 | RESERVE_SPACE(32+sizeof(nfs4_verifier)); |
1080 | WRITE32(OP_READDIR); | 1080 | WRITE32(OP_READDIR); |
@@ -1116,7 +1116,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r | |||
1116 | { | 1116 | { |
1117 | struct rpc_auth *auth = req->rq_task->tk_auth; | 1117 | struct rpc_auth *auth = req->rq_task->tk_auth; |
1118 | unsigned int replen; | 1118 | unsigned int replen; |
1119 | uint32_t *p; | 1119 | __be32 *p; |
1120 | 1120 | ||
1121 | RESERVE_SPACE(4); | 1121 | RESERVE_SPACE(4); |
1122 | WRITE32(OP_READLINK); | 1122 | WRITE32(OP_READLINK); |
@@ -1134,7 +1134,7 @@ static int encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *r | |||
1134 | 1134 | ||
1135 | static int encode_remove(struct xdr_stream *xdr, const struct qstr *name) | 1135 | static int encode_remove(struct xdr_stream *xdr, const struct qstr *name) |
1136 | { | 1136 | { |
1137 | uint32_t *p; | 1137 | __be32 *p; |
1138 | 1138 | ||
1139 | RESERVE_SPACE(8 + name->len); | 1139 | RESERVE_SPACE(8 + name->len); |
1140 | WRITE32(OP_REMOVE); | 1140 | WRITE32(OP_REMOVE); |
@@ -1146,7 +1146,7 @@ static int encode_remove(struct xdr_stream *xdr, const struct qstr *name) | |||
1146 | 1146 | ||
1147 | static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname) | 1147 | static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, const struct qstr *newname) |
1148 | { | 1148 | { |
1149 | uint32_t *p; | 1149 | __be32 *p; |
1150 | 1150 | ||
1151 | RESERVE_SPACE(8 + oldname->len); | 1151 | RESERVE_SPACE(8 + oldname->len); |
1152 | WRITE32(OP_RENAME); | 1152 | WRITE32(OP_RENAME); |
@@ -1162,7 +1162,7 @@ static int encode_rename(struct xdr_stream *xdr, const struct qstr *oldname, con | |||
1162 | 1162 | ||
1163 | static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid) | 1163 | static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_stateid) |
1164 | { | 1164 | { |
1165 | uint32_t *p; | 1165 | __be32 *p; |
1166 | 1166 | ||
1167 | RESERVE_SPACE(12); | 1167 | RESERVE_SPACE(12); |
1168 | WRITE32(OP_RENEW); | 1168 | WRITE32(OP_RENEW); |
@@ -1174,7 +1174,7 @@ static int encode_renew(struct xdr_stream *xdr, const struct nfs_client *client_ | |||
1174 | static int | 1174 | static int |
1175 | encode_restorefh(struct xdr_stream *xdr) | 1175 | encode_restorefh(struct xdr_stream *xdr) |
1176 | { | 1176 | { |
1177 | uint32_t *p; | 1177 | __be32 *p; |
1178 | 1178 | ||
1179 | RESERVE_SPACE(4); | 1179 | RESERVE_SPACE(4); |
1180 | WRITE32(OP_RESTOREFH); | 1180 | WRITE32(OP_RESTOREFH); |
@@ -1185,7 +1185,7 @@ encode_restorefh(struct xdr_stream *xdr) | |||
1185 | static int | 1185 | static int |
1186 | encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg) | 1186 | encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg) |
1187 | { | 1187 | { |
1188 | uint32_t *p; | 1188 | __be32 *p; |
1189 | 1189 | ||
1190 | RESERVE_SPACE(4+sizeof(zero_stateid.data)); | 1190 | RESERVE_SPACE(4+sizeof(zero_stateid.data)); |
1191 | WRITE32(OP_SETATTR); | 1191 | WRITE32(OP_SETATTR); |
@@ -1204,7 +1204,7 @@ encode_setacl(struct xdr_stream *xdr, struct nfs_setaclargs *arg) | |||
1204 | static int | 1204 | static int |
1205 | encode_savefh(struct xdr_stream *xdr) | 1205 | encode_savefh(struct xdr_stream *xdr) |
1206 | { | 1206 | { |
1207 | uint32_t *p; | 1207 | __be32 *p; |
1208 | 1208 | ||
1209 | RESERVE_SPACE(4); | 1209 | RESERVE_SPACE(4); |
1210 | WRITE32(OP_SAVEFH); | 1210 | WRITE32(OP_SAVEFH); |
@@ -1215,7 +1215,7 @@ encode_savefh(struct xdr_stream *xdr) | |||
1215 | static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server) | 1215 | static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs *arg, const struct nfs_server *server) |
1216 | { | 1216 | { |
1217 | int status; | 1217 | int status; |
1218 | uint32_t *p; | 1218 | __be32 *p; |
1219 | 1219 | ||
1220 | RESERVE_SPACE(4+sizeof(arg->stateid.data)); | 1220 | RESERVE_SPACE(4+sizeof(arg->stateid.data)); |
1221 | WRITE32(OP_SETATTR); | 1221 | WRITE32(OP_SETATTR); |
@@ -1229,7 +1229,7 @@ static int encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs * | |||
1229 | 1229 | ||
1230 | static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid) | 1230 | static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid) |
1231 | { | 1231 | { |
1232 | uint32_t *p; | 1232 | __be32 *p; |
1233 | 1233 | ||
1234 | RESERVE_SPACE(4 + sizeof(setclientid->sc_verifier->data)); | 1234 | RESERVE_SPACE(4 + sizeof(setclientid->sc_verifier->data)); |
1235 | WRITE32(OP_SETCLIENTID); | 1235 | WRITE32(OP_SETCLIENTID); |
@@ -1248,7 +1248,7 @@ static int encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclien | |||
1248 | 1248 | ||
1249 | static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state) | 1249 | static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_client *client_state) |
1250 | { | 1250 | { |
1251 | uint32_t *p; | 1251 | __be32 *p; |
1252 | 1252 | ||
1253 | RESERVE_SPACE(12 + sizeof(client_state->cl_confirm.data)); | 1253 | RESERVE_SPACE(12 + sizeof(client_state->cl_confirm.data)); |
1254 | WRITE32(OP_SETCLIENTID_CONFIRM); | 1254 | WRITE32(OP_SETCLIENTID_CONFIRM); |
@@ -1260,7 +1260,7 @@ static int encode_setclientid_confirm(struct xdr_stream *xdr, const struct nfs_c | |||
1260 | 1260 | ||
1261 | static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args) | 1261 | static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args) |
1262 | { | 1262 | { |
1263 | uint32_t *p; | 1263 | __be32 *p; |
1264 | 1264 | ||
1265 | RESERVE_SPACE(4); | 1265 | RESERVE_SPACE(4); |
1266 | WRITE32(OP_WRITE); | 1266 | WRITE32(OP_WRITE); |
@@ -1279,7 +1279,7 @@ static int encode_write(struct xdr_stream *xdr, const struct nfs_writeargs *args | |||
1279 | 1279 | ||
1280 | static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid) | 1280 | static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *stateid) |
1281 | { | 1281 | { |
1282 | uint32_t *p; | 1282 | __be32 *p; |
1283 | 1283 | ||
1284 | RESERVE_SPACE(20); | 1284 | RESERVE_SPACE(20); |
1285 | 1285 | ||
@@ -1295,7 +1295,7 @@ static int encode_delegreturn(struct xdr_stream *xdr, const nfs4_stateid *statei | |||
1295 | /* | 1295 | /* |
1296 | * Encode an ACCESS request | 1296 | * Encode an ACCESS request |
1297 | */ | 1297 | */ |
1298 | static int nfs4_xdr_enc_access(struct rpc_rqst *req, uint32_t *p, const struct nfs4_accessargs *args) | 1298 | static int nfs4_xdr_enc_access(struct rpc_rqst *req, __be32 *p, const struct nfs4_accessargs *args) |
1299 | { | 1299 | { |
1300 | struct xdr_stream xdr; | 1300 | struct xdr_stream xdr; |
1301 | struct compound_hdr hdr = { | 1301 | struct compound_hdr hdr = { |
@@ -1313,7 +1313,7 @@ static int nfs4_xdr_enc_access(struct rpc_rqst *req, uint32_t *p, const struct n | |||
1313 | /* | 1313 | /* |
1314 | * Encode LOOKUP request | 1314 | * Encode LOOKUP request |
1315 | */ | 1315 | */ |
1316 | static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, uint32_t *p, const struct nfs4_lookup_arg *args) | 1316 | static int nfs4_xdr_enc_lookup(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_arg *args) |
1317 | { | 1317 | { |
1318 | struct xdr_stream xdr; | 1318 | struct xdr_stream xdr; |
1319 | struct compound_hdr hdr = { | 1319 | struct compound_hdr hdr = { |
@@ -1337,7 +1337,7 @@ out: | |||
1337 | /* | 1337 | /* |
1338 | * Encode LOOKUP_ROOT request | 1338 | * Encode LOOKUP_ROOT request |
1339 | */ | 1339 | */ |
1340 | static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, uint32_t *p, const struct nfs4_lookup_root_arg *args) | 1340 | static int nfs4_xdr_enc_lookup_root(struct rpc_rqst *req, __be32 *p, const struct nfs4_lookup_root_arg *args) |
1341 | { | 1341 | { |
1342 | struct xdr_stream xdr; | 1342 | struct xdr_stream xdr; |
1343 | struct compound_hdr hdr = { | 1343 | struct compound_hdr hdr = { |
@@ -1358,7 +1358,7 @@ out: | |||
1358 | /* | 1358 | /* |
1359 | * Encode REMOVE request | 1359 | * Encode REMOVE request |
1360 | */ | 1360 | */ |
1361 | static int nfs4_xdr_enc_remove(struct rpc_rqst *req, uint32_t *p, const struct nfs4_remove_arg *args) | 1361 | static int nfs4_xdr_enc_remove(struct rpc_rqst *req, __be32 *p, const struct nfs4_remove_arg *args) |
1362 | { | 1362 | { |
1363 | struct xdr_stream xdr; | 1363 | struct xdr_stream xdr; |
1364 | struct compound_hdr hdr = { | 1364 | struct compound_hdr hdr = { |
@@ -1380,7 +1380,7 @@ out: | |||
1380 | /* | 1380 | /* |
1381 | * Encode RENAME request | 1381 | * Encode RENAME request |
1382 | */ | 1382 | */ |
1383 | static int nfs4_xdr_enc_rename(struct rpc_rqst *req, uint32_t *p, const struct nfs4_rename_arg *args) | 1383 | static int nfs4_xdr_enc_rename(struct rpc_rqst *req, __be32 *p, const struct nfs4_rename_arg *args) |
1384 | { | 1384 | { |
1385 | struct xdr_stream xdr; | 1385 | struct xdr_stream xdr; |
1386 | struct compound_hdr hdr = { | 1386 | struct compound_hdr hdr = { |
@@ -1410,7 +1410,7 @@ out: | |||
1410 | /* | 1410 | /* |
1411 | * Encode LINK request | 1411 | * Encode LINK request |
1412 | */ | 1412 | */ |
1413 | static int nfs4_xdr_enc_link(struct rpc_rqst *req, uint32_t *p, const struct nfs4_link_arg *args) | 1413 | static int nfs4_xdr_enc_link(struct rpc_rqst *req, __be32 *p, const struct nfs4_link_arg *args) |
1414 | { | 1414 | { |
1415 | struct xdr_stream xdr; | 1415 | struct xdr_stream xdr; |
1416 | struct compound_hdr hdr = { | 1416 | struct compound_hdr hdr = { |
@@ -1440,7 +1440,7 @@ out: | |||
1440 | /* | 1440 | /* |
1441 | * Encode CREATE request | 1441 | * Encode CREATE request |
1442 | */ | 1442 | */ |
1443 | static int nfs4_xdr_enc_create(struct rpc_rqst *req, uint32_t *p, const struct nfs4_create_arg *args) | 1443 | static int nfs4_xdr_enc_create(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args) |
1444 | { | 1444 | { |
1445 | struct xdr_stream xdr; | 1445 | struct xdr_stream xdr; |
1446 | struct compound_hdr hdr = { | 1446 | struct compound_hdr hdr = { |
@@ -1470,7 +1470,7 @@ out: | |||
1470 | /* | 1470 | /* |
1471 | * Encode SYMLINK request | 1471 | * Encode SYMLINK request |
1472 | */ | 1472 | */ |
1473 | static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, uint32_t *p, const struct nfs4_create_arg *args) | 1473 | static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_create_arg *args) |
1474 | { | 1474 | { |
1475 | return nfs4_xdr_enc_create(req, p, args); | 1475 | return nfs4_xdr_enc_create(req, p, args); |
1476 | } | 1476 | } |
@@ -1478,7 +1478,7 @@ static int nfs4_xdr_enc_symlink(struct rpc_rqst *req, uint32_t *p, const struct | |||
1478 | /* | 1478 | /* |
1479 | * Encode GETATTR request | 1479 | * Encode GETATTR request |
1480 | */ | 1480 | */ |
1481 | static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct nfs4_getattr_arg *args) | 1481 | static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, __be32 *p, const struct nfs4_getattr_arg *args) |
1482 | { | 1482 | { |
1483 | struct xdr_stream xdr; | 1483 | struct xdr_stream xdr; |
1484 | struct compound_hdr hdr = { | 1484 | struct compound_hdr hdr = { |
@@ -1496,7 +1496,7 @@ static int nfs4_xdr_enc_getattr(struct rpc_rqst *req, uint32_t *p, const struct | |||
1496 | /* | 1496 | /* |
1497 | * Encode a CLOSE request | 1497 | * Encode a CLOSE request |
1498 | */ | 1498 | */ |
1499 | static int nfs4_xdr_enc_close(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args) | 1499 | static int nfs4_xdr_enc_close(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args) |
1500 | { | 1500 | { |
1501 | struct xdr_stream xdr; | 1501 | struct xdr_stream xdr; |
1502 | struct compound_hdr hdr = { | 1502 | struct compound_hdr hdr = { |
@@ -1520,7 +1520,7 @@ out: | |||
1520 | /* | 1520 | /* |
1521 | * Encode an OPEN request | 1521 | * Encode an OPEN request |
1522 | */ | 1522 | */ |
1523 | static int nfs4_xdr_enc_open(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args) | 1523 | static int nfs4_xdr_enc_open(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args) |
1524 | { | 1524 | { |
1525 | struct xdr_stream xdr; | 1525 | struct xdr_stream xdr; |
1526 | struct compound_hdr hdr = { | 1526 | struct compound_hdr hdr = { |
@@ -1556,7 +1556,7 @@ out: | |||
1556 | /* | 1556 | /* |
1557 | * Encode an OPEN_CONFIRM request | 1557 | * Encode an OPEN_CONFIRM request |
1558 | */ | 1558 | */ |
1559 | static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_open_confirmargs *args) | 1559 | static int nfs4_xdr_enc_open_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_open_confirmargs *args) |
1560 | { | 1560 | { |
1561 | struct xdr_stream xdr; | 1561 | struct xdr_stream xdr; |
1562 | struct compound_hdr hdr = { | 1562 | struct compound_hdr hdr = { |
@@ -1577,7 +1577,7 @@ out: | |||
1577 | /* | 1577 | /* |
1578 | * Encode an OPEN request with no attributes. | 1578 | * Encode an OPEN request with no attributes. |
1579 | */ | 1579 | */ |
1580 | static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, uint32_t *p, struct nfs_openargs *args) | 1580 | static int nfs4_xdr_enc_open_noattr(struct rpc_rqst *req, __be32 *p, struct nfs_openargs *args) |
1581 | { | 1581 | { |
1582 | struct xdr_stream xdr; | 1582 | struct xdr_stream xdr; |
1583 | struct compound_hdr hdr = { | 1583 | struct compound_hdr hdr = { |
@@ -1601,7 +1601,7 @@ out: | |||
1601 | /* | 1601 | /* |
1602 | * Encode an OPEN_DOWNGRADE request | 1602 | * Encode an OPEN_DOWNGRADE request |
1603 | */ | 1603 | */ |
1604 | static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, uint32_t *p, struct nfs_closeargs *args) | 1604 | static int nfs4_xdr_enc_open_downgrade(struct rpc_rqst *req, __be32 *p, struct nfs_closeargs *args) |
1605 | { | 1605 | { |
1606 | struct xdr_stream xdr; | 1606 | struct xdr_stream xdr; |
1607 | struct compound_hdr hdr = { | 1607 | struct compound_hdr hdr = { |
@@ -1625,7 +1625,7 @@ out: | |||
1625 | /* | 1625 | /* |
1626 | * Encode a LOCK request | 1626 | * Encode a LOCK request |
1627 | */ | 1627 | */ |
1628 | static int nfs4_xdr_enc_lock(struct rpc_rqst *req, uint32_t *p, struct nfs_lock_args *args) | 1628 | static int nfs4_xdr_enc_lock(struct rpc_rqst *req, __be32 *p, struct nfs_lock_args *args) |
1629 | { | 1629 | { |
1630 | struct xdr_stream xdr; | 1630 | struct xdr_stream xdr; |
1631 | struct compound_hdr hdr = { | 1631 | struct compound_hdr hdr = { |
@@ -1646,7 +1646,7 @@ out: | |||
1646 | /* | 1646 | /* |
1647 | * Encode a LOCKT request | 1647 | * Encode a LOCKT request |
1648 | */ | 1648 | */ |
1649 | static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, uint32_t *p, struct nfs_lockt_args *args) | 1649 | static int nfs4_xdr_enc_lockt(struct rpc_rqst *req, __be32 *p, struct nfs_lockt_args *args) |
1650 | { | 1650 | { |
1651 | struct xdr_stream xdr; | 1651 | struct xdr_stream xdr; |
1652 | struct compound_hdr hdr = { | 1652 | struct compound_hdr hdr = { |
@@ -1667,7 +1667,7 @@ out: | |||
1667 | /* | 1667 | /* |
1668 | * Encode a LOCKU request | 1668 | * Encode a LOCKU request |
1669 | */ | 1669 | */ |
1670 | static int nfs4_xdr_enc_locku(struct rpc_rqst *req, uint32_t *p, struct nfs_locku_args *args) | 1670 | static int nfs4_xdr_enc_locku(struct rpc_rqst *req, __be32 *p, struct nfs_locku_args *args) |
1671 | { | 1671 | { |
1672 | struct xdr_stream xdr; | 1672 | struct xdr_stream xdr; |
1673 | struct compound_hdr hdr = { | 1673 | struct compound_hdr hdr = { |
@@ -1688,7 +1688,7 @@ out: | |||
1688 | /* | 1688 | /* |
1689 | * Encode a READLINK request | 1689 | * Encode a READLINK request |
1690 | */ | 1690 | */ |
1691 | static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, uint32_t *p, const struct nfs4_readlink *args) | 1691 | static int nfs4_xdr_enc_readlink(struct rpc_rqst *req, __be32 *p, const struct nfs4_readlink *args) |
1692 | { | 1692 | { |
1693 | struct xdr_stream xdr; | 1693 | struct xdr_stream xdr; |
1694 | struct compound_hdr hdr = { | 1694 | struct compound_hdr hdr = { |
@@ -1709,7 +1709,7 @@ out: | |||
1709 | /* | 1709 | /* |
1710 | * Encode a READDIR request | 1710 | * Encode a READDIR request |
1711 | */ | 1711 | */ |
1712 | static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, uint32_t *p, const struct nfs4_readdir_arg *args) | 1712 | static int nfs4_xdr_enc_readdir(struct rpc_rqst *req, __be32 *p, const struct nfs4_readdir_arg *args) |
1713 | { | 1713 | { |
1714 | struct xdr_stream xdr; | 1714 | struct xdr_stream xdr; |
1715 | struct compound_hdr hdr = { | 1715 | struct compound_hdr hdr = { |
@@ -1730,7 +1730,7 @@ out: | |||
1730 | /* | 1730 | /* |
1731 | * Encode a READ request | 1731 | * Encode a READ request |
1732 | */ | 1732 | */ |
1733 | static int nfs4_xdr_enc_read(struct rpc_rqst *req, uint32_t *p, struct nfs_readargs *args) | 1733 | static int nfs4_xdr_enc_read(struct rpc_rqst *req, __be32 *p, struct nfs_readargs *args) |
1734 | { | 1734 | { |
1735 | struct rpc_auth *auth = req->rq_task->tk_auth; | 1735 | struct rpc_auth *auth = req->rq_task->tk_auth; |
1736 | struct xdr_stream xdr; | 1736 | struct xdr_stream xdr; |
@@ -1762,7 +1762,7 @@ out: | |||
1762 | /* | 1762 | /* |
1763 | * Encode an SETATTR request | 1763 | * Encode an SETATTR request |
1764 | */ | 1764 | */ |
1765 | static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, uint32_t *p, struct nfs_setattrargs *args) | 1765 | static int nfs4_xdr_enc_setattr(struct rpc_rqst *req, __be32 *p, struct nfs_setattrargs *args) |
1766 | 1766 | ||
1767 | { | 1767 | { |
1768 | struct xdr_stream xdr; | 1768 | struct xdr_stream xdr; |
@@ -1788,7 +1788,7 @@ out: | |||
1788 | * Encode a GETACL request | 1788 | * Encode a GETACL request |
1789 | */ | 1789 | */ |
1790 | static int | 1790 | static int |
1791 | nfs4_xdr_enc_getacl(struct rpc_rqst *req, uint32_t *p, | 1791 | nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p, |
1792 | struct nfs_getaclargs *args) | 1792 | struct nfs_getaclargs *args) |
1793 | { | 1793 | { |
1794 | struct xdr_stream xdr; | 1794 | struct xdr_stream xdr; |
@@ -1815,7 +1815,7 @@ out: | |||
1815 | /* | 1815 | /* |
1816 | * Encode a WRITE request | 1816 | * Encode a WRITE request |
1817 | */ | 1817 | */ |
1818 | static int nfs4_xdr_enc_write(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args) | 1818 | static int nfs4_xdr_enc_write(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) |
1819 | { | 1819 | { |
1820 | struct xdr_stream xdr; | 1820 | struct xdr_stream xdr; |
1821 | struct compound_hdr hdr = { | 1821 | struct compound_hdr hdr = { |
@@ -1839,7 +1839,7 @@ out: | |||
1839 | /* | 1839 | /* |
1840 | * a COMMIT request | 1840 | * a COMMIT request |
1841 | */ | 1841 | */ |
1842 | static int nfs4_xdr_enc_commit(struct rpc_rqst *req, uint32_t *p, struct nfs_writeargs *args) | 1842 | static int nfs4_xdr_enc_commit(struct rpc_rqst *req, __be32 *p, struct nfs_writeargs *args) |
1843 | { | 1843 | { |
1844 | struct xdr_stream xdr; | 1844 | struct xdr_stream xdr; |
1845 | struct compound_hdr hdr = { | 1845 | struct compound_hdr hdr = { |
@@ -1863,7 +1863,7 @@ out: | |||
1863 | /* | 1863 | /* |
1864 | * FSINFO request | 1864 | * FSINFO request |
1865 | */ | 1865 | */ |
1866 | static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs4_fsinfo_arg *args) | 1866 | static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs4_fsinfo_arg *args) |
1867 | { | 1867 | { |
1868 | struct xdr_stream xdr; | 1868 | struct xdr_stream xdr; |
1869 | struct compound_hdr hdr = { | 1869 | struct compound_hdr hdr = { |
@@ -1882,7 +1882,7 @@ static int nfs4_xdr_enc_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs | |||
1882 | /* | 1882 | /* |
1883 | * a PATHCONF request | 1883 | * a PATHCONF request |
1884 | */ | 1884 | */ |
1885 | static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, uint32_t *p, const struct nfs4_pathconf_arg *args) | 1885 | static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, __be32 *p, const struct nfs4_pathconf_arg *args) |
1886 | { | 1886 | { |
1887 | struct xdr_stream xdr; | 1887 | struct xdr_stream xdr; |
1888 | struct compound_hdr hdr = { | 1888 | struct compound_hdr hdr = { |
@@ -1902,7 +1902,7 @@ static int nfs4_xdr_enc_pathconf(struct rpc_rqst *req, uint32_t *p, const struct | |||
1902 | /* | 1902 | /* |
1903 | * a STATFS request | 1903 | * a STATFS request |
1904 | */ | 1904 | */ |
1905 | static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct nfs4_statfs_arg *args) | 1905 | static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, __be32 *p, const struct nfs4_statfs_arg *args) |
1906 | { | 1906 | { |
1907 | struct xdr_stream xdr; | 1907 | struct xdr_stream xdr; |
1908 | struct compound_hdr hdr = { | 1908 | struct compound_hdr hdr = { |
@@ -1923,7 +1923,7 @@ static int nfs4_xdr_enc_statfs(struct rpc_rqst *req, uint32_t *p, const struct n | |||
1923 | /* | 1923 | /* |
1924 | * GETATTR_BITMAP request | 1924 | * GETATTR_BITMAP request |
1925 | */ | 1925 | */ |
1926 | static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, uint32_t *p, const struct nfs_fh *fhandle) | 1926 | static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, __be32 *p, const struct nfs_fh *fhandle) |
1927 | { | 1927 | { |
1928 | struct xdr_stream xdr; | 1928 | struct xdr_stream xdr; |
1929 | struct compound_hdr hdr = { | 1929 | struct compound_hdr hdr = { |
@@ -1945,7 +1945,7 @@ static int nfs4_xdr_enc_server_caps(struct rpc_rqst *req, uint32_t *p, const str | |||
1945 | /* | 1945 | /* |
1946 | * a RENEW request | 1946 | * a RENEW request |
1947 | */ | 1947 | */ |
1948 | static int nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs_client *clp) | 1948 | static int nfs4_xdr_enc_renew(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp) |
1949 | { | 1949 | { |
1950 | struct xdr_stream xdr; | 1950 | struct xdr_stream xdr; |
1951 | struct compound_hdr hdr = { | 1951 | struct compound_hdr hdr = { |
@@ -1960,7 +1960,7 @@ static int nfs4_xdr_enc_renew(struct rpc_rqst *req, uint32_t *p, struct nfs_clie | |||
1960 | /* | 1960 | /* |
1961 | * a SETCLIENTID request | 1961 | * a SETCLIENTID request |
1962 | */ | 1962 | */ |
1963 | static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p, struct nfs4_setclientid *sc) | 1963 | static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, __be32 *p, struct nfs4_setclientid *sc) |
1964 | { | 1964 | { |
1965 | struct xdr_stream xdr; | 1965 | struct xdr_stream xdr; |
1966 | struct compound_hdr hdr = { | 1966 | struct compound_hdr hdr = { |
@@ -1975,7 +1975,7 @@ static int nfs4_xdr_enc_setclientid(struct rpc_rqst *req, uint32_t *p, struct nf | |||
1975 | /* | 1975 | /* |
1976 | * a SETCLIENTID_CONFIRM request | 1976 | * a SETCLIENTID_CONFIRM request |
1977 | */ | 1977 | */ |
1978 | static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_client *clp) | 1978 | static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_client *clp) |
1979 | { | 1979 | { |
1980 | struct xdr_stream xdr; | 1980 | struct xdr_stream xdr; |
1981 | struct compound_hdr hdr = { | 1981 | struct compound_hdr hdr = { |
@@ -1997,7 +1997,7 @@ static int nfs4_xdr_enc_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, s | |||
1997 | /* | 1997 | /* |
1998 | * DELEGRETURN request | 1998 | * DELEGRETURN request |
1999 | */ | 1999 | */ |
2000 | static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, uint32_t *p, const struct nfs4_delegreturnargs *args) | 2000 | static int nfs4_xdr_enc_delegreturn(struct rpc_rqst *req, __be32 *p, const struct nfs4_delegreturnargs *args) |
2001 | { | 2001 | { |
2002 | struct xdr_stream xdr; | 2002 | struct xdr_stream xdr; |
2003 | struct compound_hdr hdr = { | 2003 | struct compound_hdr hdr = { |
@@ -2021,7 +2021,7 @@ out: | |||
2021 | /* | 2021 | /* |
2022 | * Encode FS_LOCATIONS request | 2022 | * Encode FS_LOCATIONS request |
2023 | */ | 2023 | */ |
2024 | static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs_locations_arg *args) | 2024 | static int nfs4_xdr_enc_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs4_fs_locations_arg *args) |
2025 | { | 2025 | { |
2026 | struct xdr_stream xdr; | 2026 | struct xdr_stream xdr; |
2027 | struct compound_hdr hdr = { | 2027 | struct compound_hdr hdr = { |
@@ -2086,7 +2086,7 @@ out: | |||
2086 | 2086 | ||
2087 | static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string) | 2087 | static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char **string) |
2088 | { | 2088 | { |
2089 | uint32_t *p; | 2089 | __be32 *p; |
2090 | 2090 | ||
2091 | READ_BUF(4); | 2091 | READ_BUF(4); |
2092 | READ32(*len); | 2092 | READ32(*len); |
@@ -2097,7 +2097,7 @@ static int decode_opaque_inline(struct xdr_stream *xdr, unsigned int *len, char | |||
2097 | 2097 | ||
2098 | static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) | 2098 | static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) |
2099 | { | 2099 | { |
2100 | uint32_t *p; | 2100 | __be32 *p; |
2101 | 2101 | ||
2102 | READ_BUF(8); | 2102 | READ_BUF(8); |
2103 | READ32(hdr->status); | 2103 | READ32(hdr->status); |
@@ -2112,7 +2112,7 @@ static int decode_compound_hdr(struct xdr_stream *xdr, struct compound_hdr *hdr) | |||
2112 | 2112 | ||
2113 | static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected) | 2113 | static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected) |
2114 | { | 2114 | { |
2115 | uint32_t *p; | 2115 | __be32 *p; |
2116 | uint32_t opnum; | 2116 | uint32_t opnum; |
2117 | int32_t nfserr; | 2117 | int32_t nfserr; |
2118 | 2118 | ||
@@ -2134,7 +2134,7 @@ static int decode_op_hdr(struct xdr_stream *xdr, enum nfs_opnum4 expected) | |||
2134 | /* Dummy routine */ | 2134 | /* Dummy routine */ |
2135 | static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp) | 2135 | static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp) |
2136 | { | 2136 | { |
2137 | uint32_t *p; | 2137 | __be32 *p; |
2138 | unsigned int strlen; | 2138 | unsigned int strlen; |
2139 | char *str; | 2139 | char *str; |
2140 | 2140 | ||
@@ -2144,7 +2144,8 @@ static int decode_ace(struct xdr_stream *xdr, void *ace, struct nfs_client *clp) | |||
2144 | 2144 | ||
2145 | static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) | 2145 | static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) |
2146 | { | 2146 | { |
2147 | uint32_t bmlen, *p; | 2147 | uint32_t bmlen; |
2148 | __be32 *p; | ||
2148 | 2149 | ||
2149 | READ_BUF(4); | 2150 | READ_BUF(4); |
2150 | READ32(bmlen); | 2151 | READ32(bmlen); |
@@ -2159,9 +2160,9 @@ static int decode_attr_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) | |||
2159 | return 0; | 2160 | return 0; |
2160 | } | 2161 | } |
2161 | 2162 | ||
2162 | static inline int decode_attr_length(struct xdr_stream *xdr, uint32_t *attrlen, uint32_t **savep) | 2163 | static inline int decode_attr_length(struct xdr_stream *xdr, uint32_t *attrlen, __be32 **savep) |
2163 | { | 2164 | { |
2164 | uint32_t *p; | 2165 | __be32 *p; |
2165 | 2166 | ||
2166 | READ_BUF(4); | 2167 | READ_BUF(4); |
2167 | READ32(*attrlen); | 2168 | READ32(*attrlen); |
@@ -2182,7 +2183,7 @@ static int decode_attr_supported(struct xdr_stream *xdr, uint32_t *bitmap, uint3 | |||
2182 | 2183 | ||
2183 | static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *type) | 2184 | static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *type) |
2184 | { | 2185 | { |
2185 | uint32_t *p; | 2186 | __be32 *p; |
2186 | 2187 | ||
2187 | *type = 0; | 2188 | *type = 0; |
2188 | if (unlikely(bitmap[0] & (FATTR4_WORD0_TYPE - 1U))) | 2189 | if (unlikely(bitmap[0] & (FATTR4_WORD0_TYPE - 1U))) |
@@ -2202,7 +2203,7 @@ static int decode_attr_type(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t * | |||
2202 | 2203 | ||
2203 | static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *change) | 2204 | static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *change) |
2204 | { | 2205 | { |
2205 | uint32_t *p; | 2206 | __be32 *p; |
2206 | 2207 | ||
2207 | *change = 0; | 2208 | *change = 0; |
2208 | if (unlikely(bitmap[0] & (FATTR4_WORD0_CHANGE - 1U))) | 2209 | if (unlikely(bitmap[0] & (FATTR4_WORD0_CHANGE - 1U))) |
@@ -2219,7 +2220,7 @@ static int decode_attr_change(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t | |||
2219 | 2220 | ||
2220 | static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *size) | 2221 | static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *size) |
2221 | { | 2222 | { |
2222 | uint32_t *p; | 2223 | __be32 *p; |
2223 | 2224 | ||
2224 | *size = 0; | 2225 | *size = 0; |
2225 | if (unlikely(bitmap[0] & (FATTR4_WORD0_SIZE - 1U))) | 2226 | if (unlikely(bitmap[0] & (FATTR4_WORD0_SIZE - 1U))) |
@@ -2235,7 +2236,7 @@ static int decode_attr_size(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t * | |||
2235 | 2236 | ||
2236 | static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2237 | static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2237 | { | 2238 | { |
2238 | uint32_t *p; | 2239 | __be32 *p; |
2239 | 2240 | ||
2240 | *res = 0; | 2241 | *res = 0; |
2241 | if (unlikely(bitmap[0] & (FATTR4_WORD0_LINK_SUPPORT - 1U))) | 2242 | if (unlikely(bitmap[0] & (FATTR4_WORD0_LINK_SUPPORT - 1U))) |
@@ -2251,7 +2252,7 @@ static int decode_attr_link_support(struct xdr_stream *xdr, uint32_t *bitmap, ui | |||
2251 | 2252 | ||
2252 | static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2253 | static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2253 | { | 2254 | { |
2254 | uint32_t *p; | 2255 | __be32 *p; |
2255 | 2256 | ||
2256 | *res = 0; | 2257 | *res = 0; |
2257 | if (unlikely(bitmap[0] & (FATTR4_WORD0_SYMLINK_SUPPORT - 1U))) | 2258 | if (unlikely(bitmap[0] & (FATTR4_WORD0_SYMLINK_SUPPORT - 1U))) |
@@ -2267,7 +2268,7 @@ static int decode_attr_symlink_support(struct xdr_stream *xdr, uint32_t *bitmap, | |||
2267 | 2268 | ||
2268 | static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_fsid *fsid) | 2269 | static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_fsid *fsid) |
2269 | { | 2270 | { |
2270 | uint32_t *p; | 2271 | __be32 *p; |
2271 | 2272 | ||
2272 | fsid->major = 0; | 2273 | fsid->major = 0; |
2273 | fsid->minor = 0; | 2274 | fsid->minor = 0; |
@@ -2287,7 +2288,7 @@ static int decode_attr_fsid(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs | |||
2287 | 2288 | ||
2288 | static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2289 | static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2289 | { | 2290 | { |
2290 | uint32_t *p; | 2291 | __be32 *p; |
2291 | 2292 | ||
2292 | *res = 60; | 2293 | *res = 60; |
2293 | if (unlikely(bitmap[0] & (FATTR4_WORD0_LEASE_TIME - 1U))) | 2294 | if (unlikely(bitmap[0] & (FATTR4_WORD0_LEASE_TIME - 1U))) |
@@ -2303,7 +2304,7 @@ static int decode_attr_lease_time(struct xdr_stream *xdr, uint32_t *bitmap, uint | |||
2303 | 2304 | ||
2304 | static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2305 | static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2305 | { | 2306 | { |
2306 | uint32_t *p; | 2307 | __be32 *p; |
2307 | 2308 | ||
2308 | *res = ACL4_SUPPORT_ALLOW_ACL|ACL4_SUPPORT_DENY_ACL; | 2309 | *res = ACL4_SUPPORT_ALLOW_ACL|ACL4_SUPPORT_DENY_ACL; |
2309 | if (unlikely(bitmap[0] & (FATTR4_WORD0_ACLSUPPORT - 1U))) | 2310 | if (unlikely(bitmap[0] & (FATTR4_WORD0_ACLSUPPORT - 1U))) |
@@ -2319,7 +2320,7 @@ static int decode_attr_aclsupport(struct xdr_stream *xdr, uint32_t *bitmap, uint | |||
2319 | 2320 | ||
2320 | static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) | 2321 | static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) |
2321 | { | 2322 | { |
2322 | uint32_t *p; | 2323 | __be32 *p; |
2323 | 2324 | ||
2324 | *fileid = 0; | 2325 | *fileid = 0; |
2325 | if (unlikely(bitmap[0] & (FATTR4_WORD0_FILEID - 1U))) | 2326 | if (unlikely(bitmap[0] & (FATTR4_WORD0_FILEID - 1U))) |
@@ -2335,7 +2336,7 @@ static int decode_attr_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t | |||
2335 | 2336 | ||
2336 | static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) | 2337 | static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *fileid) |
2337 | { | 2338 | { |
2338 | uint32_t *p; | 2339 | __be32 *p; |
2339 | 2340 | ||
2340 | *fileid = 0; | 2341 | *fileid = 0; |
2341 | if (unlikely(bitmap[1] & (FATTR4_WORD1_MOUNTED_ON_FILEID - 1U))) | 2342 | if (unlikely(bitmap[1] & (FATTR4_WORD1_MOUNTED_ON_FILEID - 1U))) |
@@ -2351,7 +2352,7 @@ static int decode_attr_mounted_on_fileid(struct xdr_stream *xdr, uint32_t *bitma | |||
2351 | 2352 | ||
2352 | static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2353 | static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2353 | { | 2354 | { |
2354 | uint32_t *p; | 2355 | __be32 *p; |
2355 | int status = 0; | 2356 | int status = 0; |
2356 | 2357 | ||
2357 | *res = 0; | 2358 | *res = 0; |
@@ -2368,7 +2369,7 @@ static int decode_attr_files_avail(struct xdr_stream *xdr, uint32_t *bitmap, uin | |||
2368 | 2369 | ||
2369 | static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2370 | static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2370 | { | 2371 | { |
2371 | uint32_t *p; | 2372 | __be32 *p; |
2372 | int status = 0; | 2373 | int status = 0; |
2373 | 2374 | ||
2374 | *res = 0; | 2375 | *res = 0; |
@@ -2385,7 +2386,7 @@ static int decode_attr_files_free(struct xdr_stream *xdr, uint32_t *bitmap, uint | |||
2385 | 2386 | ||
2386 | static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2387 | static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2387 | { | 2388 | { |
2388 | uint32_t *p; | 2389 | __be32 *p; |
2389 | int status = 0; | 2390 | int status = 0; |
2390 | 2391 | ||
2391 | *res = 0; | 2392 | *res = 0; |
@@ -2403,7 +2404,7 @@ static int decode_attr_files_total(struct xdr_stream *xdr, uint32_t *bitmap, uin | |||
2403 | static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path) | 2404 | static int decode_pathname(struct xdr_stream *xdr, struct nfs4_pathname *path) |
2404 | { | 2405 | { |
2405 | int n; | 2406 | int n; |
2406 | uint32_t *p; | 2407 | __be32 *p; |
2407 | int status = 0; | 2408 | int status = 0; |
2408 | 2409 | ||
2409 | READ_BUF(4); | 2410 | READ_BUF(4); |
@@ -2448,7 +2449,7 @@ out_eio: | |||
2448 | static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res) | 2449 | static int decode_attr_fs_locations(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs4_fs_locations *res) |
2449 | { | 2450 | { |
2450 | int n; | 2451 | int n; |
2451 | uint32_t *p; | 2452 | __be32 *p; |
2452 | int status = -EIO; | 2453 | int status = -EIO; |
2453 | 2454 | ||
2454 | if (unlikely(bitmap[0] & (FATTR4_WORD0_FS_LOCATIONS -1U))) | 2455 | if (unlikely(bitmap[0] & (FATTR4_WORD0_FS_LOCATIONS -1U))) |
@@ -2512,7 +2513,7 @@ out_eio: | |||
2512 | 2513 | ||
2513 | static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2514 | static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2514 | { | 2515 | { |
2515 | uint32_t *p; | 2516 | __be32 *p; |
2516 | int status = 0; | 2517 | int status = 0; |
2517 | 2518 | ||
2518 | *res = 0; | 2519 | *res = 0; |
@@ -2529,7 +2530,7 @@ static int decode_attr_maxfilesize(struct xdr_stream *xdr, uint32_t *bitmap, uin | |||
2529 | 2530 | ||
2530 | static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxlink) | 2531 | static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxlink) |
2531 | { | 2532 | { |
2532 | uint32_t *p; | 2533 | __be32 *p; |
2533 | int status = 0; | 2534 | int status = 0; |
2534 | 2535 | ||
2535 | *maxlink = 1; | 2536 | *maxlink = 1; |
@@ -2546,7 +2547,7 @@ static int decode_attr_maxlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_ | |||
2546 | 2547 | ||
2547 | static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxname) | 2548 | static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *maxname) |
2548 | { | 2549 | { |
2549 | uint32_t *p; | 2550 | __be32 *p; |
2550 | int status = 0; | 2551 | int status = 0; |
2551 | 2552 | ||
2552 | *maxname = 1024; | 2553 | *maxname = 1024; |
@@ -2563,7 +2564,7 @@ static int decode_attr_maxname(struct xdr_stream *xdr, uint32_t *bitmap, uint32_ | |||
2563 | 2564 | ||
2564 | static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2565 | static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2565 | { | 2566 | { |
2566 | uint32_t *p; | 2567 | __be32 *p; |
2567 | int status = 0; | 2568 | int status = 0; |
2568 | 2569 | ||
2569 | *res = 1024; | 2570 | *res = 1024; |
@@ -2584,7 +2585,7 @@ static int decode_attr_maxread(struct xdr_stream *xdr, uint32_t *bitmap, uint32_ | |||
2584 | 2585 | ||
2585 | static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) | 2586 | static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *res) |
2586 | { | 2587 | { |
2587 | uint32_t *p; | 2588 | __be32 *p; |
2588 | int status = 0; | 2589 | int status = 0; |
2589 | 2590 | ||
2590 | *res = 1024; | 2591 | *res = 1024; |
@@ -2605,7 +2606,7 @@ static int decode_attr_maxwrite(struct xdr_stream *xdr, uint32_t *bitmap, uint32 | |||
2605 | 2606 | ||
2606 | static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *mode) | 2607 | static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *mode) |
2607 | { | 2608 | { |
2608 | uint32_t *p; | 2609 | __be32 *p; |
2609 | 2610 | ||
2610 | *mode = 0; | 2611 | *mode = 0; |
2611 | if (unlikely(bitmap[1] & (FATTR4_WORD1_MODE - 1U))) | 2612 | if (unlikely(bitmap[1] & (FATTR4_WORD1_MODE - 1U))) |
@@ -2622,7 +2623,7 @@ static int decode_attr_mode(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t * | |||
2622 | 2623 | ||
2623 | static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *nlink) | 2624 | static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t *nlink) |
2624 | { | 2625 | { |
2625 | uint32_t *p; | 2626 | __be32 *p; |
2626 | 2627 | ||
2627 | *nlink = 1; | 2628 | *nlink = 1; |
2628 | if (unlikely(bitmap[1] & (FATTR4_WORD1_NUMLINKS - 1U))) | 2629 | if (unlikely(bitmap[1] & (FATTR4_WORD1_NUMLINKS - 1U))) |
@@ -2638,7 +2639,8 @@ static int decode_attr_nlink(struct xdr_stream *xdr, uint32_t *bitmap, uint32_t | |||
2638 | 2639 | ||
2639 | static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *uid) | 2640 | static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *uid) |
2640 | { | 2641 | { |
2641 | uint32_t len, *p; | 2642 | uint32_t len; |
2643 | __be32 *p; | ||
2642 | 2644 | ||
2643 | *uid = -2; | 2645 | *uid = -2; |
2644 | if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER - 1U))) | 2646 | if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER - 1U))) |
@@ -2662,7 +2664,8 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, struct nf | |||
2662 | 2664 | ||
2663 | static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *gid) | 2665 | static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nfs_client *clp, int32_t *gid) |
2664 | { | 2666 | { |
2665 | uint32_t len, *p; | 2667 | uint32_t len; |
2668 | __be32 *p; | ||
2666 | 2669 | ||
2667 | *gid = -2; | 2670 | *gid = -2; |
2668 | if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER_GROUP - 1U))) | 2671 | if (unlikely(bitmap[1] & (FATTR4_WORD1_OWNER_GROUP - 1U))) |
@@ -2686,7 +2689,8 @@ static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, struct nf | |||
2686 | 2689 | ||
2687 | static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rdev) | 2690 | static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rdev) |
2688 | { | 2691 | { |
2689 | uint32_t major = 0, minor = 0, *p; | 2692 | uint32_t major = 0, minor = 0; |
2693 | __be32 *p; | ||
2690 | 2694 | ||
2691 | *rdev = MKDEV(0,0); | 2695 | *rdev = MKDEV(0,0); |
2692 | if (unlikely(bitmap[1] & (FATTR4_WORD1_RAWDEV - 1U))) | 2696 | if (unlikely(bitmap[1] & (FATTR4_WORD1_RAWDEV - 1U))) |
@@ -2708,7 +2712,7 @@ static int decode_attr_rdev(struct xdr_stream *xdr, uint32_t *bitmap, dev_t *rde | |||
2708 | 2712 | ||
2709 | static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2713 | static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2710 | { | 2714 | { |
2711 | uint32_t *p; | 2715 | __be32 *p; |
2712 | int status = 0; | 2716 | int status = 0; |
2713 | 2717 | ||
2714 | *res = 0; | 2718 | *res = 0; |
@@ -2725,7 +2729,7 @@ static int decode_attr_space_avail(struct xdr_stream *xdr, uint32_t *bitmap, uin | |||
2725 | 2729 | ||
2726 | static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2730 | static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2727 | { | 2731 | { |
2728 | uint32_t *p; | 2732 | __be32 *p; |
2729 | int status = 0; | 2733 | int status = 0; |
2730 | 2734 | ||
2731 | *res = 0; | 2735 | *res = 0; |
@@ -2742,7 +2746,7 @@ static int decode_attr_space_free(struct xdr_stream *xdr, uint32_t *bitmap, uint | |||
2742 | 2746 | ||
2743 | static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) | 2747 | static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *res) |
2744 | { | 2748 | { |
2745 | uint32_t *p; | 2749 | __be32 *p; |
2746 | int status = 0; | 2750 | int status = 0; |
2747 | 2751 | ||
2748 | *res = 0; | 2752 | *res = 0; |
@@ -2759,7 +2763,7 @@ static int decode_attr_space_total(struct xdr_stream *xdr, uint32_t *bitmap, uin | |||
2759 | 2763 | ||
2760 | static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used) | 2764 | static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint64_t *used) |
2761 | { | 2765 | { |
2762 | uint32_t *p; | 2766 | __be32 *p; |
2763 | 2767 | ||
2764 | *used = 0; | 2768 | *used = 0; |
2765 | if (unlikely(bitmap[1] & (FATTR4_WORD1_SPACE_USED - 1U))) | 2769 | if (unlikely(bitmap[1] & (FATTR4_WORD1_SPACE_USED - 1U))) |
@@ -2776,7 +2780,7 @@ static int decode_attr_space_used(struct xdr_stream *xdr, uint32_t *bitmap, uint | |||
2776 | 2780 | ||
2777 | static int decode_attr_time(struct xdr_stream *xdr, struct timespec *time) | 2781 | static int decode_attr_time(struct xdr_stream *xdr, struct timespec *time) |
2778 | { | 2782 | { |
2779 | uint32_t *p; | 2783 | __be32 *p; |
2780 | uint64_t sec; | 2784 | uint64_t sec; |
2781 | uint32_t nsec; | 2785 | uint32_t nsec; |
2782 | 2786 | ||
@@ -2836,7 +2840,7 @@ static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, str | |||
2836 | return status; | 2840 | return status; |
2837 | } | 2841 | } |
2838 | 2842 | ||
2839 | static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t attrlen) | 2843 | static int verify_attr_len(struct xdr_stream *xdr, __be32 *savep, uint32_t attrlen) |
2840 | { | 2844 | { |
2841 | unsigned int attrwords = XDR_QUADLEN(attrlen); | 2845 | unsigned int attrwords = XDR_QUADLEN(attrlen); |
2842 | unsigned int nwords = xdr->p - savep; | 2846 | unsigned int nwords = xdr->p - savep; |
@@ -2854,7 +2858,7 @@ static int verify_attr_len(struct xdr_stream *xdr, uint32_t *savep, uint32_t att | |||
2854 | 2858 | ||
2855 | static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) | 2859 | static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) |
2856 | { | 2860 | { |
2857 | uint32_t *p; | 2861 | __be32 *p; |
2858 | 2862 | ||
2859 | READ_BUF(20); | 2863 | READ_BUF(20); |
2860 | READ32(cinfo->atomic); | 2864 | READ32(cinfo->atomic); |
@@ -2865,7 +2869,7 @@ static int decode_change_info(struct xdr_stream *xdr, struct nfs4_change_info *c | |||
2865 | 2869 | ||
2866 | static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access) | 2870 | static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access) |
2867 | { | 2871 | { |
2868 | uint32_t *p; | 2872 | __be32 *p; |
2869 | uint32_t supp, acc; | 2873 | uint32_t supp, acc; |
2870 | int status; | 2874 | int status; |
2871 | 2875 | ||
@@ -2882,7 +2886,7 @@ static int decode_access(struct xdr_stream *xdr, struct nfs4_accessres *access) | |||
2882 | 2886 | ||
2883 | static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res) | 2887 | static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res) |
2884 | { | 2888 | { |
2885 | uint32_t *p; | 2889 | __be32 *p; |
2886 | int status; | 2890 | int status; |
2887 | 2891 | ||
2888 | status = decode_op_hdr(xdr, OP_CLOSE); | 2892 | status = decode_op_hdr(xdr, OP_CLOSE); |
@@ -2895,7 +2899,7 @@ static int decode_close(struct xdr_stream *xdr, struct nfs_closeres *res) | |||
2895 | 2899 | ||
2896 | static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res) | 2900 | static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res) |
2897 | { | 2901 | { |
2898 | uint32_t *p; | 2902 | __be32 *p; |
2899 | int status; | 2903 | int status; |
2900 | 2904 | ||
2901 | status = decode_op_hdr(xdr, OP_COMMIT); | 2905 | status = decode_op_hdr(xdr, OP_COMMIT); |
@@ -2908,7 +2912,7 @@ static int decode_commit(struct xdr_stream *xdr, struct nfs_writeres *res) | |||
2908 | 2912 | ||
2909 | static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) | 2913 | static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) |
2910 | { | 2914 | { |
2911 | uint32_t *p; | 2915 | __be32 *p; |
2912 | uint32_t bmlen; | 2916 | uint32_t bmlen; |
2913 | int status; | 2917 | int status; |
2914 | 2918 | ||
@@ -2925,7 +2929,7 @@ static int decode_create(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) | |||
2925 | 2929 | ||
2926 | static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res) | 2930 | static int decode_server_caps(struct xdr_stream *xdr, struct nfs4_server_caps_res *res) |
2927 | { | 2931 | { |
2928 | uint32_t *savep; | 2932 | __be32 *savep; |
2929 | uint32_t attrlen, | 2933 | uint32_t attrlen, |
2930 | bitmap[2] = {0}; | 2934 | bitmap[2] = {0}; |
2931 | int status; | 2935 | int status; |
@@ -2952,7 +2956,7 @@ xdr_error: | |||
2952 | 2956 | ||
2953 | static int decode_statfs(struct xdr_stream *xdr, struct nfs_fsstat *fsstat) | 2957 | static int decode_statfs(struct xdr_stream *xdr, struct nfs_fsstat *fsstat) |
2954 | { | 2958 | { |
2955 | uint32_t *savep; | 2959 | __be32 *savep; |
2956 | uint32_t attrlen, | 2960 | uint32_t attrlen, |
2957 | bitmap[2] = {0}; | 2961 | bitmap[2] = {0}; |
2958 | int status; | 2962 | int status; |
@@ -2985,7 +2989,7 @@ xdr_error: | |||
2985 | 2989 | ||
2986 | static int decode_pathconf(struct xdr_stream *xdr, struct nfs_pathconf *pathconf) | 2990 | static int decode_pathconf(struct xdr_stream *xdr, struct nfs_pathconf *pathconf) |
2987 | { | 2991 | { |
2988 | uint32_t *savep; | 2992 | __be32 *savep; |
2989 | uint32_t attrlen, | 2993 | uint32_t attrlen, |
2990 | bitmap[2] = {0}; | 2994 | bitmap[2] = {0}; |
2991 | int status; | 2995 | int status; |
@@ -3010,7 +3014,7 @@ xdr_error: | |||
3010 | 3014 | ||
3011 | static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, const struct nfs_server *server) | 3015 | static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, const struct nfs_server *server) |
3012 | { | 3016 | { |
3013 | uint32_t *savep; | 3017 | __be32 *savep; |
3014 | uint32_t attrlen, | 3018 | uint32_t attrlen, |
3015 | bitmap[2] = {0}, | 3019 | bitmap[2] = {0}, |
3016 | type; | 3020 | type; |
@@ -3079,7 +3083,7 @@ xdr_error: | |||
3079 | 3083 | ||
3080 | static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo) | 3084 | static int decode_fsinfo(struct xdr_stream *xdr, struct nfs_fsinfo *fsinfo) |
3081 | { | 3085 | { |
3082 | uint32_t *savep; | 3086 | __be32 *savep; |
3083 | uint32_t attrlen, bitmap[2]; | 3087 | uint32_t attrlen, bitmap[2]; |
3084 | int status; | 3088 | int status; |
3085 | 3089 | ||
@@ -3111,7 +3115,7 @@ xdr_error: | |||
3111 | 3115 | ||
3112 | static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh) | 3116 | static int decode_getfh(struct xdr_stream *xdr, struct nfs_fh *fh) |
3113 | { | 3117 | { |
3114 | uint32_t *p; | 3118 | __be32 *p; |
3115 | uint32_t len; | 3119 | uint32_t len; |
3116 | int status; | 3120 | int status; |
3117 | 3121 | ||
@@ -3147,7 +3151,7 @@ static int decode_link(struct xdr_stream *xdr, struct nfs4_change_info *cinfo) | |||
3147 | static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl) | 3151 | static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl) |
3148 | { | 3152 | { |
3149 | uint64_t offset, length, clientid; | 3153 | uint64_t offset, length, clientid; |
3150 | uint32_t *p; | 3154 | __be32 *p; |
3151 | uint32_t namelen, type; | 3155 | uint32_t namelen, type; |
3152 | 3156 | ||
3153 | READ_BUF(32); | 3157 | READ_BUF(32); |
@@ -3172,7 +3176,7 @@ static int decode_lock_denied (struct xdr_stream *xdr, struct file_lock *fl) | |||
3172 | 3176 | ||
3173 | static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res) | 3177 | static int decode_lock(struct xdr_stream *xdr, struct nfs_lock_res *res) |
3174 | { | 3178 | { |
3175 | uint32_t *p; | 3179 | __be32 *p; |
3176 | int status; | 3180 | int status; |
3177 | 3181 | ||
3178 | status = decode_op_hdr(xdr, OP_LOCK); | 3182 | status = decode_op_hdr(xdr, OP_LOCK); |
@@ -3195,7 +3199,7 @@ static int decode_lockt(struct xdr_stream *xdr, struct nfs_lockt_res *res) | |||
3195 | 3199 | ||
3196 | static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res) | 3200 | static int decode_locku(struct xdr_stream *xdr, struct nfs_locku_res *res) |
3197 | { | 3201 | { |
3198 | uint32_t *p; | 3202 | __be32 *p; |
3199 | int status; | 3203 | int status; |
3200 | 3204 | ||
3201 | status = decode_op_hdr(xdr, OP_LOCKU); | 3205 | status = decode_op_hdr(xdr, OP_LOCKU); |
@@ -3214,7 +3218,7 @@ static int decode_lookup(struct xdr_stream *xdr) | |||
3214 | /* This is too sick! */ | 3218 | /* This is too sick! */ |
3215 | static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize) | 3219 | static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize) |
3216 | { | 3220 | { |
3217 | uint32_t *p; | 3221 | __be32 *p; |
3218 | uint32_t limit_type, nblocks, blocksize; | 3222 | uint32_t limit_type, nblocks, blocksize; |
3219 | 3223 | ||
3220 | READ_BUF(12); | 3224 | READ_BUF(12); |
@@ -3233,7 +3237,7 @@ static int decode_space_limit(struct xdr_stream *xdr, u64 *maxsize) | |||
3233 | 3237 | ||
3234 | static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res) | 3238 | static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res) |
3235 | { | 3239 | { |
3236 | uint32_t *p; | 3240 | __be32 *p; |
3237 | uint32_t delegation_type; | 3241 | uint32_t delegation_type; |
3238 | 3242 | ||
3239 | READ_BUF(4); | 3243 | READ_BUF(4); |
@@ -3259,7 +3263,7 @@ static int decode_delegation(struct xdr_stream *xdr, struct nfs_openres *res) | |||
3259 | 3263 | ||
3260 | static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res) | 3264 | static int decode_open(struct xdr_stream *xdr, struct nfs_openres *res) |
3261 | { | 3265 | { |
3262 | uint32_t *p; | 3266 | __be32 *p; |
3263 | uint32_t bmlen; | 3267 | uint32_t bmlen; |
3264 | int status; | 3268 | int status; |
3265 | 3269 | ||
@@ -3287,7 +3291,7 @@ xdr_error: | |||
3287 | 3291 | ||
3288 | static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res) | 3292 | static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmres *res) |
3289 | { | 3293 | { |
3290 | uint32_t *p; | 3294 | __be32 *p; |
3291 | int status; | 3295 | int status; |
3292 | 3296 | ||
3293 | status = decode_op_hdr(xdr, OP_OPEN_CONFIRM); | 3297 | status = decode_op_hdr(xdr, OP_OPEN_CONFIRM); |
@@ -3300,7 +3304,7 @@ static int decode_open_confirm(struct xdr_stream *xdr, struct nfs_open_confirmre | |||
3300 | 3304 | ||
3301 | static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res) | 3305 | static int decode_open_downgrade(struct xdr_stream *xdr, struct nfs_closeres *res) |
3302 | { | 3306 | { |
3303 | uint32_t *p; | 3307 | __be32 *p; |
3304 | int status; | 3308 | int status; |
3305 | 3309 | ||
3306 | status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE); | 3310 | status = decode_op_hdr(xdr, OP_OPEN_DOWNGRADE); |
@@ -3324,7 +3328,7 @@ static int decode_putrootfh(struct xdr_stream *xdr) | |||
3324 | static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res) | 3328 | static int decode_read(struct xdr_stream *xdr, struct rpc_rqst *req, struct nfs_readres *res) |
3325 | { | 3329 | { |
3326 | struct kvec *iov = req->rq_rcv_buf.head; | 3330 | struct kvec *iov = req->rq_rcv_buf.head; |
3327 | uint32_t *p; | 3331 | __be32 *p; |
3328 | uint32_t count, eof, recvd, hdrlen; | 3332 | uint32_t count, eof, recvd, hdrlen; |
3329 | int status; | 3333 | int status; |
3330 | 3334 | ||
@@ -3354,7 +3358,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n | |||
3354 | struct page *page = *rcvbuf->pages; | 3358 | struct page *page = *rcvbuf->pages; |
3355 | struct kvec *iov = rcvbuf->head; | 3359 | struct kvec *iov = rcvbuf->head; |
3356 | unsigned int nr, pglen = rcvbuf->page_len; | 3360 | unsigned int nr, pglen = rcvbuf->page_len; |
3357 | uint32_t *end, *entry, *p, *kaddr; | 3361 | __be32 *end, *entry, *p, *kaddr; |
3358 | uint32_t len, attrlen, xlen; | 3362 | uint32_t len, attrlen, xlen; |
3359 | int hdrlen, recvd, status; | 3363 | int hdrlen, recvd, status; |
3360 | 3364 | ||
@@ -3376,7 +3380,7 @@ static int decode_readdir(struct xdr_stream *xdr, struct rpc_rqst *req, struct n | |||
3376 | xdr_read_pages(xdr, pglen); | 3380 | xdr_read_pages(xdr, pglen); |
3377 | 3381 | ||
3378 | BUG_ON(pglen + readdir->pgbase > PAGE_CACHE_SIZE); | 3382 | BUG_ON(pglen + readdir->pgbase > PAGE_CACHE_SIZE); |
3379 | kaddr = p = (uint32_t *) kmap_atomic(page, KM_USER0); | 3383 | kaddr = p = kmap_atomic(page, KM_USER0); |
3380 | end = p + ((pglen + readdir->pgbase) >> 2); | 3384 | end = p + ((pglen + readdir->pgbase) >> 2); |
3381 | entry = p; | 3385 | entry = p; |
3382 | for (nr = 0; *p++; nr++) { | 3386 | for (nr = 0; *p++; nr++) { |
@@ -3428,7 +3432,7 @@ static int decode_readlink(struct xdr_stream *xdr, struct rpc_rqst *req) | |||
3428 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; | 3432 | struct xdr_buf *rcvbuf = &req->rq_rcv_buf; |
3429 | struct kvec *iov = rcvbuf->head; | 3433 | struct kvec *iov = rcvbuf->head; |
3430 | int hdrlen, len, recvd; | 3434 | int hdrlen, len, recvd; |
3431 | uint32_t *p; | 3435 | __be32 *p; |
3432 | char *kaddr; | 3436 | char *kaddr; |
3433 | int status; | 3437 | int status; |
3434 | 3438 | ||
@@ -3505,7 +3509,7 @@ decode_restorefh(struct xdr_stream *xdr) | |||
3505 | static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, | 3509 | static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, |
3506 | size_t *acl_len) | 3510 | size_t *acl_len) |
3507 | { | 3511 | { |
3508 | uint32_t *savep; | 3512 | __be32 *savep; |
3509 | uint32_t attrlen, | 3513 | uint32_t attrlen, |
3510 | bitmap[2] = {0}; | 3514 | bitmap[2] = {0}; |
3511 | struct kvec *iov = req->rq_rcv_buf.head; | 3515 | struct kvec *iov = req->rq_rcv_buf.head; |
@@ -3551,7 +3555,7 @@ decode_savefh(struct xdr_stream *xdr) | |||
3551 | 3555 | ||
3552 | static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res) | 3556 | static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res) |
3553 | { | 3557 | { |
3554 | uint32_t *p; | 3558 | __be32 *p; |
3555 | uint32_t bmlen; | 3559 | uint32_t bmlen; |
3556 | int status; | 3560 | int status; |
3557 | 3561 | ||
@@ -3567,7 +3571,7 @@ static int decode_setattr(struct xdr_stream *xdr, struct nfs_setattrres *res) | |||
3567 | 3571 | ||
3568 | static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp) | 3572 | static int decode_setclientid(struct xdr_stream *xdr, struct nfs_client *clp) |
3569 | { | 3573 | { |
3570 | uint32_t *p; | 3574 | __be32 *p; |
3571 | uint32_t opnum; | 3575 | uint32_t opnum; |
3572 | int32_t nfserr; | 3576 | int32_t nfserr; |
3573 | 3577 | ||
@@ -3610,7 +3614,7 @@ static int decode_setclientid_confirm(struct xdr_stream *xdr) | |||
3610 | 3614 | ||
3611 | static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res) | 3615 | static int decode_write(struct xdr_stream *xdr, struct nfs_writeres *res) |
3612 | { | 3616 | { |
3613 | uint32_t *p; | 3617 | __be32 *p; |
3614 | int status; | 3618 | int status; |
3615 | 3619 | ||
3616 | status = decode_op_hdr(xdr, OP_WRITE); | 3620 | status = decode_op_hdr(xdr, OP_WRITE); |
@@ -3632,7 +3636,7 @@ static int decode_delegreturn(struct xdr_stream *xdr) | |||
3632 | /* | 3636 | /* |
3633 | * Decode OPEN_DOWNGRADE response | 3637 | * Decode OPEN_DOWNGRADE response |
3634 | */ | 3638 | */ |
3635 | static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res) | 3639 | static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res) |
3636 | { | 3640 | { |
3637 | struct xdr_stream xdr; | 3641 | struct xdr_stream xdr; |
3638 | struct compound_hdr hdr; | 3642 | struct compound_hdr hdr; |
@@ -3660,7 +3664,7 @@ out: | |||
3660 | /* | 3664 | /* |
3661 | * Decode ACCESS response | 3665 | * Decode ACCESS response |
3662 | */ | 3666 | */ |
3663 | static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_accessres *res) | 3667 | static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_accessres *res) |
3664 | { | 3668 | { |
3665 | struct xdr_stream xdr; | 3669 | struct xdr_stream xdr; |
3666 | struct compound_hdr hdr; | 3670 | struct compound_hdr hdr; |
@@ -3678,7 +3682,7 @@ out: | |||
3678 | /* | 3682 | /* |
3679 | * Decode LOOKUP response | 3683 | * Decode LOOKUP response |
3680 | */ | 3684 | */ |
3681 | static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_lookup_res *res) | 3685 | static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res) |
3682 | { | 3686 | { |
3683 | struct xdr_stream xdr; | 3687 | struct xdr_stream xdr; |
3684 | struct compound_hdr hdr; | 3688 | struct compound_hdr hdr; |
@@ -3701,7 +3705,7 @@ out: | |||
3701 | /* | 3705 | /* |
3702 | * Decode LOOKUP_ROOT response | 3706 | * Decode LOOKUP_ROOT response |
3703 | */ | 3707 | */ |
3704 | static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_lookup_res *res) | 3708 | static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_lookup_res *res) |
3705 | { | 3709 | { |
3706 | struct xdr_stream xdr; | 3710 | struct xdr_stream xdr; |
3707 | struct compound_hdr hdr; | 3711 | struct compound_hdr hdr; |
@@ -3721,7 +3725,7 @@ out: | |||
3721 | /* | 3725 | /* |
3722 | * Decode REMOVE response | 3726 | * Decode REMOVE response |
3723 | */ | 3727 | */ |
3724 | static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_remove_res *res) | 3728 | static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_remove_res *res) |
3725 | { | 3729 | { |
3726 | struct xdr_stream xdr; | 3730 | struct xdr_stream xdr; |
3727 | struct compound_hdr hdr; | 3731 | struct compound_hdr hdr; |
@@ -3742,7 +3746,7 @@ out: | |||
3742 | /* | 3746 | /* |
3743 | * Decode RENAME response | 3747 | * Decode RENAME response |
3744 | */ | 3748 | */ |
3745 | static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_rename_res *res) | 3749 | static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_rename_res *res) |
3746 | { | 3750 | { |
3747 | struct xdr_stream xdr; | 3751 | struct xdr_stream xdr; |
3748 | struct compound_hdr hdr; | 3752 | struct compound_hdr hdr; |
@@ -3772,7 +3776,7 @@ out: | |||
3772 | /* | 3776 | /* |
3773 | * Decode LINK response | 3777 | * Decode LINK response |
3774 | */ | 3778 | */ |
3775 | static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_link_res *res) | 3779 | static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_link_res *res) |
3776 | { | 3780 | { |
3777 | struct xdr_stream xdr; | 3781 | struct xdr_stream xdr; |
3778 | struct compound_hdr hdr; | 3782 | struct compound_hdr hdr; |
@@ -3805,7 +3809,7 @@ out: | |||
3805 | /* | 3809 | /* |
3806 | * Decode CREATE response | 3810 | * Decode CREATE response |
3807 | */ | 3811 | */ |
3808 | static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_create_res *res) | 3812 | static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res) |
3809 | { | 3813 | { |
3810 | struct xdr_stream xdr; | 3814 | struct xdr_stream xdr; |
3811 | struct compound_hdr hdr; | 3815 | struct compound_hdr hdr; |
@@ -3834,7 +3838,7 @@ out: | |||
3834 | /* | 3838 | /* |
3835 | * Decode SYMLINK response | 3839 | * Decode SYMLINK response |
3836 | */ | 3840 | */ |
3837 | static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_create_res *res) | 3841 | static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_create_res *res) |
3838 | { | 3842 | { |
3839 | return nfs4_xdr_dec_create(rqstp, p, res); | 3843 | return nfs4_xdr_dec_create(rqstp, p, res); |
3840 | } | 3844 | } |
@@ -3842,7 +3846,7 @@ static int nfs4_xdr_dec_symlink(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4 | |||
3842 | /* | 3846 | /* |
3843 | * Decode GETATTR response | 3847 | * Decode GETATTR response |
3844 | */ | 3848 | */ |
3845 | static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_getattr_res *res) | 3849 | static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_getattr_res *res) |
3846 | { | 3850 | { |
3847 | struct xdr_stream xdr; | 3851 | struct xdr_stream xdr; |
3848 | struct compound_hdr hdr; | 3852 | struct compound_hdr hdr; |
@@ -3865,7 +3869,7 @@ out: | |||
3865 | * Encode an SETACL request | 3869 | * Encode an SETACL request |
3866 | */ | 3870 | */ |
3867 | static int | 3871 | static int |
3868 | nfs4_xdr_enc_setacl(struct rpc_rqst *req, uint32_t *p, struct nfs_setaclargs *args) | 3872 | nfs4_xdr_enc_setacl(struct rpc_rqst *req, __be32 *p, struct nfs_setaclargs *args) |
3869 | { | 3873 | { |
3870 | struct xdr_stream xdr; | 3874 | struct xdr_stream xdr; |
3871 | struct compound_hdr hdr = { | 3875 | struct compound_hdr hdr = { |
@@ -3886,7 +3890,7 @@ out: | |||
3886 | * Decode SETACL response | 3890 | * Decode SETACL response |
3887 | */ | 3891 | */ |
3888 | static int | 3892 | static int |
3889 | nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, uint32_t *p, void *res) | 3893 | nfs4_xdr_dec_setacl(struct rpc_rqst *rqstp, __be32 *p, void *res) |
3890 | { | 3894 | { |
3891 | struct xdr_stream xdr; | 3895 | struct xdr_stream xdr; |
3892 | struct compound_hdr hdr; | 3896 | struct compound_hdr hdr; |
@@ -3908,7 +3912,7 @@ out: | |||
3908 | * Decode GETACL response | 3912 | * Decode GETACL response |
3909 | */ | 3913 | */ |
3910 | static int | 3914 | static int |
3911 | nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, uint32_t *p, size_t *acl_len) | 3915 | nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, __be32 *p, size_t *acl_len) |
3912 | { | 3916 | { |
3913 | struct xdr_stream xdr; | 3917 | struct xdr_stream xdr; |
3914 | struct compound_hdr hdr; | 3918 | struct compound_hdr hdr; |
@@ -3930,7 +3934,7 @@ out: | |||
3930 | /* | 3934 | /* |
3931 | * Decode CLOSE response | 3935 | * Decode CLOSE response |
3932 | */ | 3936 | */ |
3933 | static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_closeres *res) | 3937 | static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, __be32 *p, struct nfs_closeres *res) |
3934 | { | 3938 | { |
3935 | struct xdr_stream xdr; | 3939 | struct xdr_stream xdr; |
3936 | struct compound_hdr hdr; | 3940 | struct compound_hdr hdr; |
@@ -3960,7 +3964,7 @@ out: | |||
3960 | /* | 3964 | /* |
3961 | * Decode OPEN response | 3965 | * Decode OPEN response |
3962 | */ | 3966 | */ |
3963 | static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res) | 3967 | static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res) |
3964 | { | 3968 | { |
3965 | struct xdr_stream xdr; | 3969 | struct xdr_stream xdr; |
3966 | struct compound_hdr hdr; | 3970 | struct compound_hdr hdr; |
@@ -3994,7 +3998,7 @@ out: | |||
3994 | /* | 3998 | /* |
3995 | * Decode OPEN_CONFIRM response | 3999 | * Decode OPEN_CONFIRM response |
3996 | */ | 4000 | */ |
3997 | static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_open_confirmres *res) | 4001 | static int nfs4_xdr_dec_open_confirm(struct rpc_rqst *rqstp, __be32 *p, struct nfs_open_confirmres *res) |
3998 | { | 4002 | { |
3999 | struct xdr_stream xdr; | 4003 | struct xdr_stream xdr; |
4000 | struct compound_hdr hdr; | 4004 | struct compound_hdr hdr; |
@@ -4015,7 +4019,7 @@ out: | |||
4015 | /* | 4019 | /* |
4016 | * Decode OPEN response | 4020 | * Decode OPEN response |
4017 | */ | 4021 | */ |
4018 | static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_openres *res) | 4022 | static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_openres *res) |
4019 | { | 4023 | { |
4020 | struct xdr_stream xdr; | 4024 | struct xdr_stream xdr; |
4021 | struct compound_hdr hdr; | 4025 | struct compound_hdr hdr; |
@@ -4039,7 +4043,7 @@ out: | |||
4039 | /* | 4043 | /* |
4040 | * Decode SETATTR response | 4044 | * Decode SETATTR response |
4041 | */ | 4045 | */ |
4042 | static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_setattrres *res) | 4046 | static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, __be32 *p, struct nfs_setattrres *res) |
4043 | { | 4047 | { |
4044 | struct xdr_stream xdr; | 4048 | struct xdr_stream xdr; |
4045 | struct compound_hdr hdr; | 4049 | struct compound_hdr hdr; |
@@ -4065,7 +4069,7 @@ out: | |||
4065 | /* | 4069 | /* |
4066 | * Decode LOCK response | 4070 | * Decode LOCK response |
4067 | */ | 4071 | */ |
4068 | static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lock_res *res) | 4072 | static int nfs4_xdr_dec_lock(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lock_res *res) |
4069 | { | 4073 | { |
4070 | struct xdr_stream xdr; | 4074 | struct xdr_stream xdr; |
4071 | struct compound_hdr hdr; | 4075 | struct compound_hdr hdr; |
@@ -4086,7 +4090,7 @@ out: | |||
4086 | /* | 4090 | /* |
4087 | * Decode LOCKT response | 4091 | * Decode LOCKT response |
4088 | */ | 4092 | */ |
4089 | static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_lockt_res *res) | 4093 | static int nfs4_xdr_dec_lockt(struct rpc_rqst *rqstp, __be32 *p, struct nfs_lockt_res *res) |
4090 | { | 4094 | { |
4091 | struct xdr_stream xdr; | 4095 | struct xdr_stream xdr; |
4092 | struct compound_hdr hdr; | 4096 | struct compound_hdr hdr; |
@@ -4107,7 +4111,7 @@ out: | |||
4107 | /* | 4111 | /* |
4108 | * Decode LOCKU response | 4112 | * Decode LOCKU response |
4109 | */ | 4113 | */ |
4110 | static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_locku_res *res) | 4114 | static int nfs4_xdr_dec_locku(struct rpc_rqst *rqstp, __be32 *p, struct nfs_locku_res *res) |
4111 | { | 4115 | { |
4112 | struct xdr_stream xdr; | 4116 | struct xdr_stream xdr; |
4113 | struct compound_hdr hdr; | 4117 | struct compound_hdr hdr; |
@@ -4128,7 +4132,7 @@ out: | |||
4128 | /* | 4132 | /* |
4129 | * Decode READLINK response | 4133 | * Decode READLINK response |
4130 | */ | 4134 | */ |
4131 | static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, uint32_t *p, void *res) | 4135 | static int nfs4_xdr_dec_readlink(struct rpc_rqst *rqstp, __be32 *p, void *res) |
4132 | { | 4136 | { |
4133 | struct xdr_stream xdr; | 4137 | struct xdr_stream xdr; |
4134 | struct compound_hdr hdr; | 4138 | struct compound_hdr hdr; |
@@ -4149,7 +4153,7 @@ out: | |||
4149 | /* | 4153 | /* |
4150 | * Decode READDIR response | 4154 | * Decode READDIR response |
4151 | */ | 4155 | */ |
4152 | static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_readdir_res *res) | 4156 | static int nfs4_xdr_dec_readdir(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_readdir_res *res) |
4153 | { | 4157 | { |
4154 | struct xdr_stream xdr; | 4158 | struct xdr_stream xdr; |
4155 | struct compound_hdr hdr; | 4159 | struct compound_hdr hdr; |
@@ -4170,7 +4174,7 @@ out: | |||
4170 | /* | 4174 | /* |
4171 | * Decode Read response | 4175 | * Decode Read response |
4172 | */ | 4176 | */ |
4173 | static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_readres *res) | 4177 | static int nfs4_xdr_dec_read(struct rpc_rqst *rqstp, __be32 *p, struct nfs_readres *res) |
4174 | { | 4178 | { |
4175 | struct xdr_stream xdr; | 4179 | struct xdr_stream xdr; |
4176 | struct compound_hdr hdr; | 4180 | struct compound_hdr hdr; |
@@ -4193,7 +4197,7 @@ out: | |||
4193 | /* | 4197 | /* |
4194 | * Decode WRITE response | 4198 | * Decode WRITE response |
4195 | */ | 4199 | */ |
4196 | static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res) | 4200 | static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res) |
4197 | { | 4201 | { |
4198 | struct xdr_stream xdr; | 4202 | struct xdr_stream xdr; |
4199 | struct compound_hdr hdr; | 4203 | struct compound_hdr hdr; |
@@ -4219,7 +4223,7 @@ out: | |||
4219 | /* | 4223 | /* |
4220 | * Decode COMMIT response | 4224 | * Decode COMMIT response |
4221 | */ | 4225 | */ |
4222 | static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, uint32_t *p, struct nfs_writeres *res) | 4226 | static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, __be32 *p, struct nfs_writeres *res) |
4223 | { | 4227 | { |
4224 | struct xdr_stream xdr; | 4228 | struct xdr_stream xdr; |
4225 | struct compound_hdr hdr; | 4229 | struct compound_hdr hdr; |
@@ -4243,7 +4247,7 @@ out: | |||
4243 | /* | 4247 | /* |
4244 | * FSINFO request | 4248 | * FSINFO request |
4245 | */ | 4249 | */ |
4246 | static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo) | 4250 | static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo) |
4247 | { | 4251 | { |
4248 | struct xdr_stream xdr; | 4252 | struct xdr_stream xdr; |
4249 | struct compound_hdr hdr; | 4253 | struct compound_hdr hdr; |
@@ -4263,7 +4267,7 @@ static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, uint32_t *p, struct nfs_fsi | |||
4263 | /* | 4267 | /* |
4264 | * PATHCONF request | 4268 | * PATHCONF request |
4265 | */ | 4269 | */ |
4266 | static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, uint32_t *p, struct nfs_pathconf *pathconf) | 4270 | static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p, struct nfs_pathconf *pathconf) |
4267 | { | 4271 | { |
4268 | struct xdr_stream xdr; | 4272 | struct xdr_stream xdr; |
4269 | struct compound_hdr hdr; | 4273 | struct compound_hdr hdr; |
@@ -4281,7 +4285,7 @@ static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, uint32_t *p, struct nfs_p | |||
4281 | /* | 4285 | /* |
4282 | * STATFS request | 4286 | * STATFS request |
4283 | */ | 4287 | */ |
4284 | static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fsstat *fsstat) | 4288 | static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p, struct nfs_fsstat *fsstat) |
4285 | { | 4289 | { |
4286 | struct xdr_stream xdr; | 4290 | struct xdr_stream xdr; |
4287 | struct compound_hdr hdr; | 4291 | struct compound_hdr hdr; |
@@ -4299,7 +4303,7 @@ static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, uint32_t *p, struct nfs_fss | |||
4299 | /* | 4303 | /* |
4300 | * GETATTR_BITMAP request | 4304 | * GETATTR_BITMAP request |
4301 | */ | 4305 | */ |
4302 | static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, uint32_t *p, struct nfs4_server_caps_res *res) | 4306 | static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, __be32 *p, struct nfs4_server_caps_res *res) |
4303 | { | 4307 | { |
4304 | struct xdr_stream xdr; | 4308 | struct xdr_stream xdr; |
4305 | struct compound_hdr hdr; | 4309 | struct compound_hdr hdr; |
@@ -4318,7 +4322,7 @@ out: | |||
4318 | /* | 4322 | /* |
4319 | * Decode RENEW response | 4323 | * Decode RENEW response |
4320 | */ | 4324 | */ |
4321 | static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy) | 4325 | static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, __be32 *p, void *dummy) |
4322 | { | 4326 | { |
4323 | struct xdr_stream xdr; | 4327 | struct xdr_stream xdr; |
4324 | struct compound_hdr hdr; | 4328 | struct compound_hdr hdr; |
@@ -4334,7 +4338,7 @@ static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, uint32_t *p, void *dummy) | |||
4334 | /* | 4338 | /* |
4335 | * a SETCLIENTID request | 4339 | * a SETCLIENTID request |
4336 | */ | 4340 | */ |
4337 | static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p, | 4341 | static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p, |
4338 | struct nfs_client *clp) | 4342 | struct nfs_client *clp) |
4339 | { | 4343 | { |
4340 | struct xdr_stream xdr; | 4344 | struct xdr_stream xdr; |
@@ -4353,7 +4357,7 @@ static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, uint32_t *p, | |||
4353 | /* | 4357 | /* |
4354 | * a SETCLIENTID_CONFIRM request | 4358 | * a SETCLIENTID_CONFIRM request |
4355 | */ | 4359 | */ |
4356 | static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, struct nfs_fsinfo *fsinfo) | 4360 | static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo) |
4357 | { | 4361 | { |
4358 | struct xdr_stream xdr; | 4362 | struct xdr_stream xdr; |
4359 | struct compound_hdr hdr; | 4363 | struct compound_hdr hdr; |
@@ -4375,7 +4379,7 @@ static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, uint32_t *p, s | |||
4375 | /* | 4379 | /* |
4376 | * DELEGRETURN request | 4380 | * DELEGRETURN request |
4377 | */ | 4381 | */ |
4378 | static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_delegreturnres *res) | 4382 | static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_delegreturnres *res) |
4379 | { | 4383 | { |
4380 | struct xdr_stream xdr; | 4384 | struct xdr_stream xdr; |
4381 | struct compound_hdr hdr; | 4385 | struct compound_hdr hdr; |
@@ -4397,7 +4401,7 @@ out: | |||
4397 | /* | 4401 | /* |
4398 | * FS_LOCATIONS request | 4402 | * FS_LOCATIONS request |
4399 | */ | 4403 | */ |
4400 | static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, uint32_t *p, struct nfs4_fs_locations *res) | 4404 | static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, __be32 *p, struct nfs4_fs_locations *res) |
4401 | { | 4405 | { |
4402 | struct xdr_stream xdr; | 4406 | struct xdr_stream xdr; |
4403 | struct compound_hdr hdr; | 4407 | struct compound_hdr hdr; |
@@ -4417,7 +4421,7 @@ out: | |||
4417 | return status; | 4421 | return status; |
4418 | } | 4422 | } |
4419 | 4423 | ||
4420 | uint32_t *nfs4_decode_dirent(uint32_t *p, struct nfs_entry *entry, int plus) | 4424 | __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) |
4421 | { | 4425 | { |
4422 | uint32_t bitmap[2] = {0}; | 4426 | uint32_t bitmap[2] = {0}; |
4423 | uint32_t len; | 4427 | uint32_t len; |
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c index 8dfefe41a8..75f819dc02 100644 --- a/fs/nfs/nfsroot.c +++ b/fs/nfs/nfsroot.c | |||
@@ -98,7 +98,7 @@ | |||
98 | static char nfs_root_name[256] __initdata = ""; | 98 | static char nfs_root_name[256] __initdata = ""; |
99 | 99 | ||
100 | /* Address of NFS server */ | 100 | /* Address of NFS server */ |
101 | static __u32 servaddr __initdata = 0; | 101 | static __be32 servaddr __initdata = 0; |
102 | 102 | ||
103 | /* Name of directory to mount */ | 103 | /* Name of directory to mount */ |
104 | static char nfs_path[NFS_MAXPATHLEN] __initdata = { 0, }; | 104 | static char nfs_path[NFS_MAXPATHLEN] __initdata = { 0, }; |
@@ -327,7 +327,7 @@ static int __init root_nfs_name(char *name) | |||
327 | */ | 327 | */ |
328 | static int __init root_nfs_addr(void) | 328 | static int __init root_nfs_addr(void) |
329 | { | 329 | { |
330 | if ((servaddr = root_server_addr) == INADDR_NONE) { | 330 | if ((servaddr = root_server_addr) == htonl(INADDR_NONE)) { |
331 | printk(KERN_ERR "Root-NFS: No NFS server available, giving up.\n"); | 331 | printk(KERN_ERR "Root-NFS: No NFS server available, giving up.\n"); |
332 | return -1; | 332 | return -1; |
333 | } | 333 | } |
@@ -411,7 +411,7 @@ __setup("nfsroot=", nfs_root_setup); | |||
411 | * Construct sockaddr_in from address and port number. | 411 | * Construct sockaddr_in from address and port number. |
412 | */ | 412 | */ |
413 | static inline void | 413 | static inline void |
414 | set_sockaddr(struct sockaddr_in *sin, __u32 addr, __u16 port) | 414 | set_sockaddr(struct sockaddr_in *sin, __be32 addr, __be16 port) |
415 | { | 415 | { |
416 | sin->sin_family = AF_INET; | 416 | sin->sin_family = AF_INET; |
417 | sin->sin_addr.s_addr = addr; | 417 | sin->sin_addr.s_addr = addr; |
@@ -468,14 +468,13 @@ static int __init root_nfs_ports(void) | |||
468 | dprintk("Root-NFS: Portmapper on server returned %d " | 468 | dprintk("Root-NFS: Portmapper on server returned %d " |
469 | "as nfsd port\n", port); | 469 | "as nfsd port\n", port); |
470 | } | 470 | } |
471 | nfs_port = htons(nfs_port); | ||
472 | 471 | ||
473 | if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) { | 472 | if ((port = root_nfs_getport(NFS_MNT_PROGRAM, mountd_ver, proto)) < 0) { |
474 | printk(KERN_ERR "Root-NFS: Unable to get mountd port " | 473 | printk(KERN_ERR "Root-NFS: Unable to get mountd port " |
475 | "number from server, using default\n"); | 474 | "number from server, using default\n"); |
476 | port = mountd_port; | 475 | port = mountd_port; |
477 | } | 476 | } |
478 | mount_port = htons(port); | 477 | mount_port = port; |
479 | dprintk("Root-NFS: mountd port is %d\n", port); | 478 | dprintk("Root-NFS: mountd port is %d\n", port); |
480 | 479 | ||
481 | return 0; | 480 | return 0; |
@@ -496,7 +495,7 @@ static int __init root_nfs_get_handle(void) | |||
496 | int version = (nfs_data.flags & NFS_MOUNT_VER3) ? | 495 | int version = (nfs_data.flags & NFS_MOUNT_VER3) ? |
497 | NFS_MNT3_VERSION : NFS_MNT_VERSION; | 496 | NFS_MNT3_VERSION : NFS_MNT_VERSION; |
498 | 497 | ||
499 | set_sockaddr(&sin, servaddr, mount_port); | 498 | set_sockaddr(&sin, servaddr, htons(mount_port)); |
500 | status = nfsroot_mount(&sin, nfs_path, &fh, version, protocol); | 499 | status = nfsroot_mount(&sin, nfs_path, &fh, version, protocol); |
501 | if (status < 0) | 500 | if (status < 0) |
502 | printk(KERN_ERR "Root-NFS: Server returned error %d " | 501 | printk(KERN_ERR "Root-NFS: Server returned error %d " |
@@ -519,6 +518,6 @@ void * __init nfs_root_data(void) | |||
519 | || root_nfs_ports() < 0 | 518 | || root_nfs_ports() < 0 |
520 | || root_nfs_get_handle() < 0) | 519 | || root_nfs_get_handle() < 0) |
521 | return NULL; | 520 | return NULL; |
522 | set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, nfs_port); | 521 | set_sockaddr((struct sockaddr_in *) &nfs_data.addr, servaddr, htons(nfs_port)); |
523 | return (void*)&nfs_data; | 522 | return (void*)&nfs_data; |
524 | } | 523 | } |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 28659a919d..28108c82b8 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -834,7 +834,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type, | |||
834 | } | 834 | } |
835 | /* RFC3530: The default port for NFS is 2049 */ | 835 | /* RFC3530: The default port for NFS is 2049 */ |
836 | if (addr.sin_port == 0) | 836 | if (addr.sin_port == 0) |
837 | addr.sin_port = NFS_PORT; | 837 | addr.sin_port = htons(NFS_PORT); |
838 | 838 | ||
839 | /* Grab the authentication type */ | 839 | /* Grab the authentication type */ |
840 | authflavour = RPC_AUTH_UNIX; | 840 | authflavour = RPC_AUTH_UNIX; |
diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c index 2fe3403c24..3ea50ac648 100644 --- a/fs/nfs/sysctl.c +++ b/fs/nfs/sysctl.c | |||
@@ -18,11 +18,6 @@ | |||
18 | static const int nfs_set_port_min = 0; | 18 | static const int nfs_set_port_min = 0; |
19 | static const int nfs_set_port_max = 65535; | 19 | static const int nfs_set_port_max = 65535; |
20 | static struct ctl_table_header *nfs_callback_sysctl_table; | 20 | static struct ctl_table_header *nfs_callback_sysctl_table; |
21 | /* | ||
22 | * Something that isn't CTL_ANY, CTL_NONE or a value that may clash. | ||
23 | * Use the same values as fs/lockd/svc.c | ||
24 | */ | ||
25 | #define CTL_UNNUMBERED -2 | ||
26 | 21 | ||
27 | static ctl_table nfs_cb_sysctls[] = { | 22 | static ctl_table nfs_cb_sysctls[] = { |
28 | #ifdef CONFIG_NFS_V4 | 23 | #ifdef CONFIG_NFS_V4 |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index f6675d2c38..883dd4a1c1 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -57,6 +57,8 @@ | |||
57 | #include <linux/nfs_fs.h> | 57 | #include <linux/nfs_fs.h> |
58 | #include <linux/nfs_mount.h> | 58 | #include <linux/nfs_mount.h> |
59 | #include <linux/nfs_page.h> | 59 | #include <linux/nfs_page.h> |
60 | #include <linux/backing-dev.h> | ||
61 | |||
60 | #include <asm/uaccess.h> | 62 | #include <asm/uaccess.h> |
61 | #include <linux/smp_lock.h> | 63 | #include <linux/smp_lock.h> |
62 | 64 | ||
@@ -395,7 +397,7 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) | |||
395 | out: | 397 | out: |
396 | clear_bit(BDI_write_congested, &bdi->state); | 398 | clear_bit(BDI_write_congested, &bdi->state); |
397 | wake_up_all(&nfs_write_congestion); | 399 | wake_up_all(&nfs_write_congestion); |
398 | writeback_congestion_end(); | 400 | congestion_end(WRITE); |
399 | return err; | 401 | return err; |
400 | } | 402 | } |
401 | 403 | ||
@@ -588,10 +590,10 @@ static void nfs_cancel_commit_list(struct list_head *head) | |||
588 | 590 | ||
589 | while(!list_empty(head)) { | 591 | while(!list_empty(head)) { |
590 | req = nfs_list_entry(head->next); | 592 | req = nfs_list_entry(head->next); |
593 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | ||
591 | nfs_list_remove_request(req); | 594 | nfs_list_remove_request(req); |
592 | nfs_inode_remove_request(req); | 595 | nfs_inode_remove_request(req); |
593 | dec_zone_page_state(req->wb_page, NR_UNSTABLE_NFS); | 596 | nfs_unlock_request(req); |
594 | nfs_clear_page_writeback(req); | ||
595 | } | 597 | } |
596 | } | 598 | } |
597 | 599 | ||