diff options
-rw-r--r-- | fs/nfs/nfs2xdr.c | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/fs/nfs/nfs2xdr.c b/fs/nfs/nfs2xdr.c index b49501fc0a79..1d801e30c40e 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) |
@@ -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 | ||