aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-20 02:28:46 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:40 -0400
commit52921e02a4f4163a7b1f4b5dde71e1debc71de4a (patch)
tree0202a8a4c8c78aed1826540fb33faf64a88837ce /fs/lockd
parent7111c66e4e70588c9602035a4996c9cdc2087d2d (diff)
[PATCH] lockd endianness annotations
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no> Acked-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/lockd')
-rw-r--r--fs/lockd/clntlock.c4
-rw-r--r--fs/lockd/mon.c12
-rw-r--r--fs/lockd/svc4proc.c4
-rw-r--r--fs/lockd/svclock.c10
-rw-r--r--fs/lockd/svcproc.c8
-rw-r--r--fs/lockd/svcshare.c4
-rw-r--r--fs/lockd/svcsubs.c4
-rw-r--r--fs/lockd/xdr.c76
-rw-r--r--fs/lockd/xdr4.c80
9 files changed, 101 insertions, 101 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index e8c7765419e8..b85a0ad2cfb6 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -100,12 +100,12 @@ int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout)
100/* 100/*
101 * The server lockd has called us back to tell us the lock was granted 101 * The server lockd has called us back to tell us the lock was granted
102 */ 102 */
103u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock) 103__be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *lock)
104{ 104{
105 const struct file_lock *fl = &lock->fl; 105 const struct file_lock *fl = &lock->fl;
106 const struct nfs_fh *fh = &lock->fh; 106 const struct nfs_fh *fh = &lock->fh;
107 struct nlm_wait *block; 107 struct nlm_wait *block;
108 u32 res = nlm_lck_denied; 108 __be32 res = nlm_lck_denied;
109 109
110 /* 110 /*
111 * Look up blocked request based on arguments. 111 * Look up blocked request based on arguments.
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c
index e0179f8c327f..eb243edf8932 100644
--- a/fs/lockd/mon.c
+++ b/fs/lockd/mon.c
@@ -148,8 +148,8 @@ nsm_create(void)
148 * XDR functions for NSM. 148 * XDR functions for NSM.
149 */ 149 */
150 150
151static u32 * 151static __be32 *
152xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp) 152xdr_encode_common(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
153{ 153{
154 char buffer[20], *name; 154 char buffer[20], *name;
155 155
@@ -176,7 +176,7 @@ xdr_encode_common(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
176} 176}
177 177
178static int 178static int
179xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp) 179xdr_encode_mon(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
180{ 180{
181 p = xdr_encode_common(rqstp, p, argp); 181 p = xdr_encode_common(rqstp, p, argp);
182 if (IS_ERR(p)) 182 if (IS_ERR(p))
@@ -192,7 +192,7 @@ xdr_encode_mon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
192} 192}
193 193
194static int 194static int
195xdr_encode_unmon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp) 195xdr_encode_unmon(struct rpc_rqst *rqstp, __be32 *p, struct nsm_args *argp)
196{ 196{
197 p = xdr_encode_common(rqstp, p, argp); 197 p = xdr_encode_common(rqstp, p, argp);
198 if (IS_ERR(p)) 198 if (IS_ERR(p))
@@ -202,7 +202,7 @@ xdr_encode_unmon(struct rpc_rqst *rqstp, u32 *p, struct nsm_args *argp)
202} 202}
203 203
204static int 204static int
205xdr_decode_stat_res(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp) 205xdr_decode_stat_res(struct rpc_rqst *rqstp, __be32 *p, struct nsm_res *resp)
206{ 206{
207 resp->status = ntohl(*p++); 207 resp->status = ntohl(*p++);
208 resp->state = ntohl(*p++); 208 resp->state = ntohl(*p++);
@@ -212,7 +212,7 @@ xdr_decode_stat_res(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp)
212} 212}
213 213
214static int 214static int
215xdr_decode_stat(struct rpc_rqst *rqstp, u32 *p, struct nsm_res *resp) 215xdr_decode_stat(struct rpc_rqst *rqstp, __be32 *p, struct nsm_res *resp)
216{ 216{
217 resp->state = ntohl(*p++); 217 resp->state = ntohl(*p++);
218 return 0; 218 return 0;
diff --git a/fs/lockd/svc4proc.c b/fs/lockd/svc4proc.c
index 4e719860b4bf..0ce5c81ff507 100644
--- a/fs/lockd/svc4proc.c
+++ b/fs/lockd/svc4proc.c
@@ -24,14 +24,14 @@
24/* 24/*
25 * Obtain client and file from arguments 25 * Obtain client and file from arguments
26 */ 26 */
27static u32 27static __be32
28nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp, 28nlm4svc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
29 struct nlm_host **hostp, struct nlm_file **filp) 29 struct nlm_host **hostp, struct nlm_file **filp)
30{ 30{
31 struct nlm_host *host = NULL; 31 struct nlm_host *host = NULL;
32 struct nlm_file *file = NULL; 32 struct nlm_file *file = NULL;
33 struct nlm_lock *lock = &argp->lock; 33 struct nlm_lock *lock = &argp->lock;
34 u32 error = 0; 34 __be32 error = 0;
35 35
36 /* nfsd callbacks must have been installed for this procedure */ 36 /* nfsd callbacks must have been installed for this procedure */
37 if (!nlmsvc_ops) 37 if (!nlmsvc_ops)
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index 814c6064c9e0..7e219b938552 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -334,13 +334,13 @@ static void nlmsvc_freegrantargs(struct nlm_rqst *call)
334 * Attempt to establish a lock, and if it can't be granted, block it 334 * Attempt to establish a lock, and if it can't be granted, block it
335 * if required. 335 * if required.
336 */ 336 */
337u32 337__be32
338nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, 338nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file,
339 struct nlm_lock *lock, int wait, struct nlm_cookie *cookie) 339 struct nlm_lock *lock, int wait, struct nlm_cookie *cookie)
340{ 340{
341 struct nlm_block *block, *newblock = NULL; 341 struct nlm_block *block, *newblock = NULL;
342 int error; 342 int error;
343 u32 ret; 343 __be32 ret;
344 344
345 dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n", 345 dprintk("lockd: nlmsvc_lock(%s/%ld, ty=%d, pi=%d, %Ld-%Ld, bl=%d)\n",
346 file->f_file->f_dentry->d_inode->i_sb->s_id, 346 file->f_file->f_dentry->d_inode->i_sb->s_id,
@@ -415,7 +415,7 @@ out:
415/* 415/*
416 * Test for presence of a conflicting lock. 416 * Test for presence of a conflicting lock.
417 */ 417 */
418u32 418__be32
419nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock, 419nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
420 struct nlm_lock *conflock) 420 struct nlm_lock *conflock)
421{ 421{
@@ -448,7 +448,7 @@ nlmsvc_testlock(struct nlm_file *file, struct nlm_lock *lock,
448 * afterwards. In this case the block will still be there, and hence 448 * afterwards. In this case the block will still be there, and hence
449 * must be removed. 449 * must be removed.
450 */ 450 */
451u32 451__be32
452nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock) 452nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
453{ 453{
454 int error; 454 int error;
@@ -476,7 +476,7 @@ nlmsvc_unlock(struct nlm_file *file, struct nlm_lock *lock)
476 * be in progress. 476 * be in progress.
477 * The calling procedure must check whether the file can be closed. 477 * The calling procedure must check whether the file can be closed.
478 */ 478 */
479u32 479__be32
480nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock) 480nlmsvc_cancel_blocked(struct nlm_file *file, struct nlm_lock *lock)
481{ 481{
482 struct nlm_block *block; 482 struct nlm_block *block;
diff --git a/fs/lockd/svcproc.c b/fs/lockd/svcproc.c
index db8d85c32d29..32e99a6e8dca 100644
--- a/fs/lockd/svcproc.c
+++ b/fs/lockd/svcproc.c
@@ -22,8 +22,8 @@
22#define NLMDBG_FACILITY NLMDBG_CLIENT 22#define NLMDBG_FACILITY NLMDBG_CLIENT
23 23
24#ifdef CONFIG_LOCKD_V4 24#ifdef CONFIG_LOCKD_V4
25static u32 25static __be32
26cast_to_nlm(u32 status, u32 vers) 26cast_to_nlm(__be32 status, u32 vers)
27{ 27{
28 /* Note: status is assumed to be in network byte order !!! */ 28 /* Note: status is assumed to be in network byte order !!! */
29 if (vers != 4){ 29 if (vers != 4){
@@ -52,14 +52,14 @@ cast_to_nlm(u32 status, u32 vers)
52/* 52/*
53 * Obtain client and file from arguments 53 * Obtain client and file from arguments
54 */ 54 */
55static u32 55static __be32
56nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp, 56nlmsvc_retrieve_args(struct svc_rqst *rqstp, struct nlm_args *argp,
57 struct nlm_host **hostp, struct nlm_file **filp) 57 struct nlm_host **hostp, struct nlm_file **filp)
58{ 58{
59 struct nlm_host *host = NULL; 59 struct nlm_host *host = NULL;
60 struct nlm_file *file = NULL; 60 struct nlm_file *file = NULL;
61 struct nlm_lock *lock = &argp->lock; 61 struct nlm_lock *lock = &argp->lock;
62 u32 error = 0; 62 __be32 error = 0;
63 63
64 /* nfsd callbacks must have been installed for this procedure */ 64 /* nfsd callbacks must have been installed for this procedure */
65 if (!nlmsvc_ops) 65 if (!nlmsvc_ops)
diff --git a/fs/lockd/svcshare.c b/fs/lockd/svcshare.c
index b9926ce8782e..6220dc2a3f2c 100644
--- a/fs/lockd/svcshare.c
+++ b/fs/lockd/svcshare.c
@@ -23,7 +23,7 @@ nlm_cmp_owner(struct nlm_share *share, struct xdr_netobj *oh)
23 && !memcmp(share->s_owner.data, oh->data, oh->len); 23 && !memcmp(share->s_owner.data, oh->data, oh->len);
24} 24}
25 25
26u32 26__be32
27nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file, 27nlmsvc_share_file(struct nlm_host *host, struct nlm_file *file,
28 struct nlm_args *argp) 28 struct nlm_args *argp)
29{ 29{
@@ -64,7 +64,7 @@ update:
64/* 64/*
65 * Delete a share. 65 * Delete a share.
66 */ 66 */
67u32 67__be32
68nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file, 68nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
69 struct nlm_args *argp) 69 struct nlm_args *argp)
70{ 70{
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c
index 7dac96e6c82c..e83024e16042 100644
--- a/fs/lockd/svcsubs.c
+++ b/fs/lockd/svcsubs.c
@@ -78,14 +78,14 @@ static inline unsigned int file_hash(struct nfs_fh *f)
78 * This is not quite right, but for now, we assume the client performs 78 * This is not quite right, but for now, we assume the client performs
79 * the proper R/W checking. 79 * the proper R/W checking.
80 */ 80 */
81u32 81__be32
82nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result, 82nlm_lookup_file(struct svc_rqst *rqstp, struct nlm_file **result,
83 struct nfs_fh *f) 83 struct nfs_fh *f)
84{ 84{
85 struct hlist_node *pos; 85 struct hlist_node *pos;
86 struct nlm_file *file; 86 struct nlm_file *file;
87 unsigned int hash; 87 unsigned int hash;
88 u32 nfserr; 88 __be32 nfserr;
89 89
90 nlm_debug_print_fh("nlm_file_lookup", f); 90 nlm_debug_print_fh("nlm_file_lookup", f);
91 91
diff --git a/fs/lockd/xdr.c b/fs/lockd/xdr.c
index 61c46facf257..b7c949256e5a 100644
--- a/fs/lockd/xdr.c
+++ b/fs/lockd/xdr.c
@@ -43,7 +43,7 @@ loff_t_to_s32(loff_t offset)
43/* 43/*
44 * XDR functions for basic NLM types 44 * XDR functions for basic NLM types
45 */ 45 */
46static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c) 46static __be32 *nlm_decode_cookie(__be32 *p, struct nlm_cookie *c)
47{ 47{
48 unsigned int len; 48 unsigned int len;
49 49
@@ -69,8 +69,8 @@ static u32 *nlm_decode_cookie(u32 *p, struct nlm_cookie *c)
69 return p; 69 return p;
70} 70}
71 71
72static inline u32 * 72static inline __be32 *
73nlm_encode_cookie(u32 *p, struct nlm_cookie *c) 73nlm_encode_cookie(__be32 *p, struct nlm_cookie *c)
74{ 74{
75 *p++ = htonl(c->len); 75 *p++ = htonl(c->len);
76 memcpy(p, c->data, c->len); 76 memcpy(p, c->data, c->len);
@@ -78,8 +78,8 @@ nlm_encode_cookie(u32 *p, struct nlm_cookie *c)
78 return p; 78 return p;
79} 79}
80 80
81static u32 * 81static __be32 *
82nlm_decode_fh(u32 *p, struct nfs_fh *f) 82nlm_decode_fh(__be32 *p, struct nfs_fh *f)
83{ 83{
84 unsigned int len; 84 unsigned int len;
85 85
@@ -95,8 +95,8 @@ nlm_decode_fh(u32 *p, struct nfs_fh *f)
95 return p + XDR_QUADLEN(NFS2_FHSIZE); 95 return p + XDR_QUADLEN(NFS2_FHSIZE);
96} 96}
97 97
98static inline u32 * 98static inline __be32 *
99nlm_encode_fh(u32 *p, struct nfs_fh *f) 99nlm_encode_fh(__be32 *p, struct nfs_fh *f)
100{ 100{
101 *p++ = htonl(NFS2_FHSIZE); 101 *p++ = htonl(NFS2_FHSIZE);
102 memcpy(p, f->data, NFS2_FHSIZE); 102 memcpy(p, f->data, NFS2_FHSIZE);
@@ -106,20 +106,20 @@ nlm_encode_fh(u32 *p, struct nfs_fh *f)
106/* 106/*
107 * Encode and decode owner handle 107 * Encode and decode owner handle
108 */ 108 */
109static inline u32 * 109static inline __be32 *
110nlm_decode_oh(u32 *p, struct xdr_netobj *oh) 110nlm_decode_oh(__be32 *p, struct xdr_netobj *oh)
111{ 111{
112 return xdr_decode_netobj(p, oh); 112 return xdr_decode_netobj(p, oh);
113} 113}
114 114
115static inline u32 * 115static inline __be32 *
116nlm_encode_oh(u32 *p, struct xdr_netobj *oh) 116nlm_encode_oh(__be32 *p, struct xdr_netobj *oh)
117{ 117{
118 return xdr_encode_netobj(p, oh); 118 return xdr_encode_netobj(p, oh);
119} 119}
120 120
121static u32 * 121static __be32 *
122nlm_decode_lock(u32 *p, struct nlm_lock *lock) 122nlm_decode_lock(__be32 *p, struct nlm_lock *lock)
123{ 123{
124 struct file_lock *fl = &lock->fl; 124 struct file_lock *fl = &lock->fl;
125 s32 start, len, end; 125 s32 start, len, end;
@@ -153,8 +153,8 @@ nlm_decode_lock(u32 *p, struct nlm_lock *lock)
153/* 153/*
154 * Encode a lock as part of an NLM call 154 * Encode a lock as part of an NLM call
155 */ 155 */
156static u32 * 156static __be32 *
157nlm_encode_lock(u32 *p, struct nlm_lock *lock) 157nlm_encode_lock(__be32 *p, struct nlm_lock *lock)
158{ 158{
159 struct file_lock *fl = &lock->fl; 159 struct file_lock *fl = &lock->fl;
160 __s32 start, len; 160 __s32 start, len;
@@ -184,8 +184,8 @@ nlm_encode_lock(u32 *p, struct nlm_lock *lock)
184/* 184/*
185 * Encode result of a TEST/TEST_MSG call 185 * Encode result of a TEST/TEST_MSG call
186 */ 186 */
187static u32 * 187static __be32 *
188nlm_encode_testres(u32 *p, struct nlm_res *resp) 188nlm_encode_testres(__be32 *p, struct nlm_res *resp)
189{ 189{
190 s32 start, len; 190 s32 start, len;
191 191
@@ -221,7 +221,7 @@ nlm_encode_testres(u32 *p, struct nlm_res *resp)
221 * First, the server side XDR functions 221 * First, the server side XDR functions
222 */ 222 */
223int 223int
224nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 224nlmsvc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
225{ 225{
226 u32 exclusive; 226 u32 exclusive;
227 227
@@ -238,7 +238,7 @@ nlmsvc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
238} 238}
239 239
240int 240int
241nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 241nlmsvc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
242{ 242{
243 if (!(p = nlm_encode_testres(p, resp))) 243 if (!(p = nlm_encode_testres(p, resp)))
244 return 0; 244 return 0;
@@ -246,7 +246,7 @@ nlmsvc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
246} 246}
247 247
248int 248int
249nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 249nlmsvc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
250{ 250{
251 u32 exclusive; 251 u32 exclusive;
252 252
@@ -266,7 +266,7 @@ nlmsvc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
266} 266}
267 267
268int 268int
269nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 269nlmsvc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
270{ 270{
271 u32 exclusive; 271 u32 exclusive;
272 272
@@ -282,7 +282,7 @@ nlmsvc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
282} 282}
283 283
284int 284int
285nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 285nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
286{ 286{
287 if (!(p = nlm_decode_cookie(p, &argp->cookie)) 287 if (!(p = nlm_decode_cookie(p, &argp->cookie))
288 || !(p = nlm_decode_lock(p, &argp->lock))) 288 || !(p = nlm_decode_lock(p, &argp->lock)))
@@ -292,7 +292,7 @@ nlmsvc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
292} 292}
293 293
294int 294int
295nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 295nlmsvc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
296{ 296{
297 struct nlm_lock *lock = &argp->lock; 297 struct nlm_lock *lock = &argp->lock;
298 298
@@ -313,7 +313,7 @@ nlmsvc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
313} 313}
314 314
315int 315int
316nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 316nlmsvc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
317{ 317{
318 if (!(p = nlm_encode_cookie(p, &resp->cookie))) 318 if (!(p = nlm_encode_cookie(p, &resp->cookie)))
319 return 0; 319 return 0;
@@ -323,7 +323,7 @@ nlmsvc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
323} 323}
324 324
325int 325int
326nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 326nlmsvc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
327{ 327{
328 if (!(p = nlm_encode_cookie(p, &resp->cookie))) 328 if (!(p = nlm_encode_cookie(p, &resp->cookie)))
329 return 0; 329 return 0;
@@ -332,7 +332,7 @@ nlmsvc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
332} 332}
333 333
334int 334int
335nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) 335nlmsvc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
336{ 336{
337 struct nlm_lock *lock = &argp->lock; 337 struct nlm_lock *lock = &argp->lock;
338 338
@@ -344,7 +344,7 @@ nlmsvc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
344} 344}
345 345
346int 346int
347nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) 347nlmsvc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp)
348{ 348{
349 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) 349 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
350 return 0; 350 return 0;
@@ -357,7 +357,7 @@ nlmsvc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
357} 357}
358 358
359int 359int
360nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 360nlmsvc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
361{ 361{
362 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 362 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
363 return 0; 363 return 0;
@@ -366,13 +366,13 @@ nlmsvc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
366} 366}
367 367
368int 368int
369nlmsvc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 369nlmsvc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
370{ 370{
371 return xdr_argsize_check(rqstp, p); 371 return xdr_argsize_check(rqstp, p);
372} 372}
373 373
374int 374int
375nlmsvc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 375nlmsvc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
376{ 376{
377 return xdr_ressize_check(rqstp, p); 377 return xdr_ressize_check(rqstp, p);
378} 378}
@@ -389,7 +389,7 @@ nlmclt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr)
389#endif 389#endif
390 390
391static int 391static int
392nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 392nlmclt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
393{ 393{
394 struct nlm_lock *lock = &argp->lock; 394 struct nlm_lock *lock = &argp->lock;
395 395
@@ -403,7 +403,7 @@ nlmclt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
403} 403}
404 404
405static int 405static int
406nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 406nlmclt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
407{ 407{
408 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 408 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
409 return -EIO; 409 return -EIO;
@@ -438,7 +438,7 @@ nlmclt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
438 438
439 439
440static int 440static int
441nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 441nlmclt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
442{ 442{
443 struct nlm_lock *lock = &argp->lock; 443 struct nlm_lock *lock = &argp->lock;
444 444
@@ -455,7 +455,7 @@ nlmclt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
455} 455}
456 456
457static int 457static int
458nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 458nlmclt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
459{ 459{
460 struct nlm_lock *lock = &argp->lock; 460 struct nlm_lock *lock = &argp->lock;
461 461
@@ -470,7 +470,7 @@ nlmclt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
470} 470}
471 471
472static int 472static int
473nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 473nlmclt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
474{ 474{
475 struct nlm_lock *lock = &argp->lock; 475 struct nlm_lock *lock = &argp->lock;
476 476
@@ -483,7 +483,7 @@ nlmclt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
483} 483}
484 484
485static int 485static int
486nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 486nlmclt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
487{ 487{
488 if (!(p = nlm_encode_cookie(p, &resp->cookie))) 488 if (!(p = nlm_encode_cookie(p, &resp->cookie)))
489 return -EIO; 489 return -EIO;
@@ -493,7 +493,7 @@ nlmclt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
493} 493}
494 494
495static int 495static int
496nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 496nlmclt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
497{ 497{
498 if (!(p = nlm_encode_testres(p, resp))) 498 if (!(p = nlm_encode_testres(p, resp)))
499 return -EIO; 499 return -EIO;
@@ -502,7 +502,7 @@ nlmclt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
502} 502}
503 503
504static int 504static int
505nlmclt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 505nlmclt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
506{ 506{
507 if (!(p = nlm_decode_cookie(p, &resp->cookie))) 507 if (!(p = nlm_decode_cookie(p, &resp->cookie)))
508 return -EIO; 508 return -EIO;
diff --git a/fs/lockd/xdr4.c b/fs/lockd/xdr4.c
index 36eb175ec335..f4c0b2b9f75a 100644
--- a/fs/lockd/xdr4.c
+++ b/fs/lockd/xdr4.c
@@ -44,8 +44,8 @@ loff_t_to_s64(loff_t offset)
44/* 44/*
45 * XDR functions for basic NLM types 45 * XDR functions for basic NLM types
46 */ 46 */
47static u32 * 47static __be32 *
48nlm4_decode_cookie(u32 *p, struct nlm_cookie *c) 48nlm4_decode_cookie(__be32 *p, struct nlm_cookie *c)
49{ 49{
50 unsigned int len; 50 unsigned int len;
51 51
@@ -71,8 +71,8 @@ nlm4_decode_cookie(u32 *p, struct nlm_cookie *c)
71 return p; 71 return p;
72} 72}
73 73
74static u32 * 74static __be32 *
75nlm4_encode_cookie(u32 *p, struct nlm_cookie *c) 75nlm4_encode_cookie(__be32 *p, struct nlm_cookie *c)
76{ 76{
77 *p++ = htonl(c->len); 77 *p++ = htonl(c->len);
78 memcpy(p, c->data, c->len); 78 memcpy(p, c->data, c->len);
@@ -80,8 +80,8 @@ nlm4_encode_cookie(u32 *p, struct nlm_cookie *c)
80 return p; 80 return p;
81} 81}
82 82
83static u32 * 83static __be32 *
84nlm4_decode_fh(u32 *p, struct nfs_fh *f) 84nlm4_decode_fh(__be32 *p, struct nfs_fh *f)
85{ 85{
86 memset(f->data, 0, sizeof(f->data)); 86 memset(f->data, 0, sizeof(f->data));
87 f->size = ntohl(*p++); 87 f->size = ntohl(*p++);
@@ -95,8 +95,8 @@ nlm4_decode_fh(u32 *p, struct nfs_fh *f)
95 return p + XDR_QUADLEN(f->size); 95 return p + XDR_QUADLEN(f->size);
96} 96}
97 97
98static u32 * 98static __be32 *
99nlm4_encode_fh(u32 *p, struct nfs_fh *f) 99nlm4_encode_fh(__be32 *p, struct nfs_fh *f)
100{ 100{
101 *p++ = htonl(f->size); 101 *p++ = htonl(f->size);
102 if (f->size) p[XDR_QUADLEN(f->size)-1] = 0; /* don't leak anything */ 102 if (f->size) p[XDR_QUADLEN(f->size)-1] = 0; /* don't leak anything */
@@ -107,20 +107,20 @@ nlm4_encode_fh(u32 *p, struct nfs_fh *f)
107/* 107/*
108 * Encode and decode owner handle 108 * Encode and decode owner handle
109 */ 109 */
110static u32 * 110static __be32 *
111nlm4_decode_oh(u32 *p, struct xdr_netobj *oh) 111nlm4_decode_oh(__be32 *p, struct xdr_netobj *oh)
112{ 112{
113 return xdr_decode_netobj(p, oh); 113 return xdr_decode_netobj(p, oh);
114} 114}
115 115
116static u32 * 116static __be32 *
117nlm4_encode_oh(u32 *p, struct xdr_netobj *oh) 117nlm4_encode_oh(__be32 *p, struct xdr_netobj *oh)
118{ 118{
119 return xdr_encode_netobj(p, oh); 119 return xdr_encode_netobj(p, oh);
120} 120}
121 121
122static u32 * 122static __be32 *
123nlm4_decode_lock(u32 *p, struct nlm_lock *lock) 123nlm4_decode_lock(__be32 *p, struct nlm_lock *lock)
124{ 124{
125 struct file_lock *fl = &lock->fl; 125 struct file_lock *fl = &lock->fl;
126 __s64 len, start, end; 126 __s64 len, start, end;
@@ -153,8 +153,8 @@ nlm4_decode_lock(u32 *p, struct nlm_lock *lock)
153/* 153/*
154 * Encode a lock as part of an NLM call 154 * Encode a lock as part of an NLM call
155 */ 155 */
156static u32 * 156static __be32 *
157nlm4_encode_lock(u32 *p, struct nlm_lock *lock) 157nlm4_encode_lock(__be32 *p, struct nlm_lock *lock)
158{ 158{
159 struct file_lock *fl = &lock->fl; 159 struct file_lock *fl = &lock->fl;
160 __s64 start, len; 160 __s64 start, len;
@@ -185,8 +185,8 @@ nlm4_encode_lock(u32 *p, struct nlm_lock *lock)
185/* 185/*
186 * Encode result of a TEST/TEST_MSG call 186 * Encode result of a TEST/TEST_MSG call
187 */ 187 */
188static u32 * 188static __be32 *
189nlm4_encode_testres(u32 *p, struct nlm_res *resp) 189nlm4_encode_testres(__be32 *p, struct nlm_res *resp)
190{ 190{
191 s64 start, len; 191 s64 start, len;
192 192
@@ -227,7 +227,7 @@ nlm4_encode_testres(u32 *p, struct nlm_res *resp)
227 * First, the server side XDR functions 227 * First, the server side XDR functions
228 */ 228 */
229int 229int
230nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 230nlm4svc_decode_testargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
231{ 231{
232 u32 exclusive; 232 u32 exclusive;
233 233
@@ -244,7 +244,7 @@ nlm4svc_decode_testargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
244} 244}
245 245
246int 246int
247nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 247nlm4svc_encode_testres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
248{ 248{
249 if (!(p = nlm4_encode_testres(p, resp))) 249 if (!(p = nlm4_encode_testres(p, resp)))
250 return 0; 250 return 0;
@@ -252,7 +252,7 @@ nlm4svc_encode_testres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
252} 252}
253 253
254int 254int
255nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 255nlm4svc_decode_lockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
256{ 256{
257 u32 exclusive; 257 u32 exclusive;
258 258
@@ -272,7 +272,7 @@ nlm4svc_decode_lockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
272} 272}
273 273
274int 274int
275nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 275nlm4svc_decode_cancargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
276{ 276{
277 u32 exclusive; 277 u32 exclusive;
278 278
@@ -288,7 +288,7 @@ nlm4svc_decode_cancargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
288} 288}
289 289
290int 290int
291nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 291nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
292{ 292{
293 if (!(p = nlm4_decode_cookie(p, &argp->cookie)) 293 if (!(p = nlm4_decode_cookie(p, &argp->cookie))
294 || !(p = nlm4_decode_lock(p, &argp->lock))) 294 || !(p = nlm4_decode_lock(p, &argp->lock)))
@@ -298,7 +298,7 @@ nlm4svc_decode_unlockargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
298} 298}
299 299
300int 300int
301nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp) 301nlm4svc_decode_shareargs(struct svc_rqst *rqstp, __be32 *p, nlm_args *argp)
302{ 302{
303 struct nlm_lock *lock = &argp->lock; 303 struct nlm_lock *lock = &argp->lock;
304 304
@@ -319,7 +319,7 @@ nlm4svc_decode_shareargs(struct svc_rqst *rqstp, u32 *p, nlm_args *argp)
319} 319}
320 320
321int 321int
322nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 322nlm4svc_encode_shareres(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
323{ 323{
324 if (!(p = nlm4_encode_cookie(p, &resp->cookie))) 324 if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
325 return 0; 325 return 0;
@@ -329,7 +329,7 @@ nlm4svc_encode_shareres(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
329} 329}
330 330
331int 331int
332nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 332nlm4svc_encode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
333{ 333{
334 if (!(p = nlm4_encode_cookie(p, &resp->cookie))) 334 if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
335 return 0; 335 return 0;
@@ -338,7 +338,7 @@ nlm4svc_encode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
338} 338}
339 339
340int 340int
341nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp) 341nlm4svc_decode_notify(struct svc_rqst *rqstp, __be32 *p, struct nlm_args *argp)
342{ 342{
343 struct nlm_lock *lock = &argp->lock; 343 struct nlm_lock *lock = &argp->lock;
344 344
@@ -350,7 +350,7 @@ nlm4svc_decode_notify(struct svc_rqst *rqstp, u32 *p, struct nlm_args *argp)
350} 350}
351 351
352int 352int
353nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp) 353nlm4svc_decode_reboot(struct svc_rqst *rqstp, __be32 *p, struct nlm_reboot *argp)
354{ 354{
355 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN))) 355 if (!(p = xdr_decode_string_inplace(p, &argp->mon, &argp->len, SM_MAXSTRLEN)))
356 return 0; 356 return 0;
@@ -363,7 +363,7 @@ nlm4svc_decode_reboot(struct svc_rqst *rqstp, u32 *p, struct nlm_reboot *argp)
363} 363}
364 364
365int 365int
366nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp) 366nlm4svc_decode_res(struct svc_rqst *rqstp, __be32 *p, struct nlm_res *resp)
367{ 367{
368 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 368 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
369 return 0; 369 return 0;
@@ -372,13 +372,13 @@ nlm4svc_decode_res(struct svc_rqst *rqstp, u32 *p, struct nlm_res *resp)
372} 372}
373 373
374int 374int
375nlm4svc_decode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 375nlm4svc_decode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
376{ 376{
377 return xdr_argsize_check(rqstp, p); 377 return xdr_argsize_check(rqstp, p);
378} 378}
379 379
380int 380int
381nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy) 381nlm4svc_encode_void(struct svc_rqst *rqstp, __be32 *p, void *dummy)
382{ 382{
383 return xdr_ressize_check(rqstp, p); 383 return xdr_ressize_check(rqstp, p);
384} 384}
@@ -388,14 +388,14 @@ nlm4svc_encode_void(struct svc_rqst *rqstp, u32 *p, void *dummy)
388 */ 388 */
389#ifdef NLMCLNT_SUPPORT_SHARES 389#ifdef NLMCLNT_SUPPORT_SHARES
390static int 390static int
391nlm4clt_decode_void(struct rpc_rqst *req, u32 *p, void *ptr) 391nlm4clt_decode_void(struct rpc_rqst *req, __be32 *p, void *ptr)
392{ 392{
393 return 0; 393 return 0;
394} 394}
395#endif 395#endif
396 396
397static int 397static int
398nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 398nlm4clt_encode_testargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
399{ 399{
400 struct nlm_lock *lock = &argp->lock; 400 struct nlm_lock *lock = &argp->lock;
401 401
@@ -409,7 +409,7 @@ nlm4clt_encode_testargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
409} 409}
410 410
411static int 411static int
412nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 412nlm4clt_decode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
413{ 413{
414 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 414 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
415 return -EIO; 415 return -EIO;
@@ -444,7 +444,7 @@ nlm4clt_decode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
444 444
445 445
446static int 446static int
447nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 447nlm4clt_encode_lockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
448{ 448{
449 struct nlm_lock *lock = &argp->lock; 449 struct nlm_lock *lock = &argp->lock;
450 450
@@ -461,7 +461,7 @@ nlm4clt_encode_lockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
461} 461}
462 462
463static int 463static int
464nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 464nlm4clt_encode_cancargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
465{ 465{
466 struct nlm_lock *lock = &argp->lock; 466 struct nlm_lock *lock = &argp->lock;
467 467
@@ -476,7 +476,7 @@ nlm4clt_encode_cancargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
476} 476}
477 477
478static int 478static int
479nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp) 479nlm4clt_encode_unlockargs(struct rpc_rqst *req, __be32 *p, nlm_args *argp)
480{ 480{
481 struct nlm_lock *lock = &argp->lock; 481 struct nlm_lock *lock = &argp->lock;
482 482
@@ -489,7 +489,7 @@ nlm4clt_encode_unlockargs(struct rpc_rqst *req, u32 *p, nlm_args *argp)
489} 489}
490 490
491static int 491static int
492nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 492nlm4clt_encode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
493{ 493{
494 if (!(p = nlm4_encode_cookie(p, &resp->cookie))) 494 if (!(p = nlm4_encode_cookie(p, &resp->cookie)))
495 return -EIO; 495 return -EIO;
@@ -499,7 +499,7 @@ nlm4clt_encode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
499} 499}
500 500
501static int 501static int
502nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 502nlm4clt_encode_testres(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
503{ 503{
504 if (!(p = nlm4_encode_testres(p, resp))) 504 if (!(p = nlm4_encode_testres(p, resp)))
505 return -EIO; 505 return -EIO;
@@ -508,7 +508,7 @@ nlm4clt_encode_testres(struct rpc_rqst *req, u32 *p, struct nlm_res *resp)
508} 508}
509 509
510static int 510static int
511nlm4clt_decode_res(struct rpc_rqst *req, u32 *p, struct nlm_res *resp) 511nlm4clt_decode_res(struct rpc_rqst *req, __be32 *p, struct nlm_res *resp)
512{ 512{
513 if (!(p = nlm4_decode_cookie(p, &resp->cookie))) 513 if (!(p = nlm4_decode_cookie(p, &resp->cookie)))
514 return -EIO; 514 return -EIO;