aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-10-20 02:28:58 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:26:41 -0400
commit2ebbc012a9433a252be7ab4ce54e94bf7b21e506 (patch)
treedaedb0484892bf3d8f7df42836de7b62391c1c3f
parent91f07168cef8e99dd16f608fbc703e7a5af0237f (diff)
[PATCH] xdr annotations: NFSv4 server
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>
-rw-r--r--fs/nfsd/nfs4proc.c2
-rw-r--r--fs/nfsd/nfs4xdr.c66
-rw-r--r--include/linux/nfsd/xdr4.h24
3 files changed, 46 insertions, 46 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 795ad6c5cb2c..ca6414248527 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -664,7 +664,7 @@ nfsd4_write(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_writ
664static int 664static int
665nfsd4_verify(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_verify *verify) 665nfsd4_verify(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_verify *verify)
666{ 666{
667 u32 *buf, *p; 667 __be32 *buf, *p;
668 int count; 668 int count;
669 int status; 669 int status;
670 670
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 77be0c4785e6..3419d99aeb1a 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -94,7 +94,7 @@ check_filename(char *str, int len, int err)
94 * consistent with the style used in NFSv2/v3... 94 * consistent with the style used in NFSv2/v3...
95 */ 95 */
96#define DECODE_HEAD \ 96#define DECODE_HEAD \
97 u32 *p; \ 97 __be32 *p; \
98 int status 98 int status
99#define DECODE_TAIL \ 99#define DECODE_TAIL \
100 status = 0; \ 100 status = 0; \
@@ -144,13 +144,13 @@ xdr_error: \
144 } \ 144 } \
145} while (0) 145} while (0)
146 146
147static u32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes) 147static __be32 *read_buf(struct nfsd4_compoundargs *argp, int nbytes)
148{ 148{
149 /* We want more bytes than seem to be available. 149 /* We want more bytes than seem to be available.
150 * Maybe we need a new page, maybe we have just run out 150 * Maybe we need a new page, maybe we have just run out
151 */ 151 */
152 int avail = (char*)argp->end - (char*)argp->p; 152 int avail = (char*)argp->end - (char*)argp->p;
153 u32 *p; 153 __be32 *p;
154 if (avail + argp->pagelen < nbytes) 154 if (avail + argp->pagelen < nbytes)
155 return NULL; 155 return NULL;
156 if (avail + PAGE_SIZE < nbytes) /* need more than a page !! */ 156 if (avail + PAGE_SIZE < nbytes) /* need more than a page !! */
@@ -197,7 +197,7 @@ defer_free(struct nfsd4_compoundargs *argp,
197 return 0; 197 return 0;
198} 198}
199 199
200static char *savemem(struct nfsd4_compoundargs *argp, u32 *p, int nbytes) 200static char *savemem(struct nfsd4_compoundargs *argp, __be32 *p, int nbytes)
201{ 201{
202 void *new = NULL; 202 void *new = NULL;
203 if (p == argp->tmp) { 203 if (p == argp->tmp) {
@@ -951,8 +951,8 @@ nfsd4_decode_write(struct nfsd4_compoundargs *argp, struct nfsd4_write *write)
951 argp->pagelen -= len; 951 argp->pagelen -= len;
952 } 952 }
953 } 953 }
954 argp->end = (u32*) (argp->rqstp->rq_vec[v].iov_base + argp->rqstp->rq_vec[v].iov_len); 954 argp->end = (__be32*) (argp->rqstp->rq_vec[v].iov_base + argp->rqstp->rq_vec[v].iov_len);
955 argp->p = (u32*) (argp->rqstp->rq_vec[v].iov_base + (XDR_QUADLEN(len) << 2)); 955 argp->p = (__be32*) (argp->rqstp->rq_vec[v].iov_base + (XDR_QUADLEN(len) << 2));
956 argp->rqstp->rq_vec[v].iov_len = len; 956 argp->rqstp->rq_vec[v].iov_len = len;
957 write->wr_vlen = v+1; 957 write->wr_vlen = v+1;
958 958
@@ -1179,7 +1179,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1179 * task to translate them into Linux-specific versions which are more 1179 * task to translate them into Linux-specific versions which are more
1180 * consistent with the style used in NFSv2/v3... 1180 * consistent with the style used in NFSv2/v3...
1181 */ 1181 */
1182#define ENCODE_HEAD u32 *p 1182#define ENCODE_HEAD __be32 *p
1183 1183
1184#define WRITE32(n) *p++ = htonl(n) 1184#define WRITE32(n) *p++ = htonl(n)
1185#define WRITE64(n) do { \ 1185#define WRITE64(n) do { \
@@ -1209,8 +1209,8 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1209 * Header routine to setup seqid operation replay cache 1209 * Header routine to setup seqid operation replay cache
1210 */ 1210 */
1211#define ENCODE_SEQID_OP_HEAD \ 1211#define ENCODE_SEQID_OP_HEAD \
1212 u32 *p; \ 1212 __be32 *p; \
1213 u32 *save; \ 1213 __be32 *save; \
1214 \ 1214 \
1215 save = resp->p; 1215 save = resp->p;
1216 1216
@@ -1235,10 +1235,10 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
1235 * seperated @sep. 1235 * seperated @sep.
1236 */ 1236 */
1237static int nfsd4_encode_components(char sep, char *components, 1237static int nfsd4_encode_components(char sep, char *components,
1238 u32 **pp, int *buflen) 1238 __be32 **pp, int *buflen)
1239{ 1239{
1240 u32 *p = *pp; 1240 __be32 *p = *pp;
1241 u32 *countp = p; 1241 __be32 *countp = p;
1242 int strlen, count=0; 1242 int strlen, count=0;
1243 char *str, *end; 1243 char *str, *end;
1244 1244
@@ -1272,10 +1272,10 @@ static int nfsd4_encode_components(char sep, char *components,
1272 * encode a location element of a fs_locations structure 1272 * encode a location element of a fs_locations structure
1273 */ 1273 */
1274static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location, 1274static int nfsd4_encode_fs_location4(struct nfsd4_fs_location *location,
1275 u32 **pp, int *buflen) 1275 __be32 **pp, int *buflen)
1276{ 1276{
1277 int status; 1277 int status;
1278 u32 *p = *pp; 1278 __be32 *p = *pp;
1279 1279
1280 status = nfsd4_encode_components(':', location->hosts, &p, buflen); 1280 status = nfsd4_encode_components(':', location->hosts, &p, buflen);
1281 if (status) 1281 if (status)
@@ -1320,11 +1320,11 @@ static char *nfsd4_path(struct svc_rqst *rqstp, struct svc_export *exp, u32 *sta
1320 */ 1320 */
1321static int nfsd4_encode_fs_locations(struct svc_rqst *rqstp, 1321static int nfsd4_encode_fs_locations(struct svc_rqst *rqstp,
1322 struct svc_export *exp, 1322 struct svc_export *exp,
1323 u32 **pp, int *buflen) 1323 __be32 **pp, int *buflen)
1324{ 1324{
1325 u32 status; 1325 u32 status;
1326 int i; 1326 int i;
1327 u32 *p = *pp; 1327 __be32 *p = *pp;
1328 struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs; 1328 struct nfsd4_fs_locations *fslocs = &exp->ex_fslocs;
1329 char *root = nfsd4_path(rqstp, exp, &status); 1329 char *root = nfsd4_path(rqstp, exp, &status);
1330 1330
@@ -1355,7 +1355,7 @@ static u32 nfs4_ftypes[16] = {
1355 1355
1356static int 1356static int
1357nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group, 1357nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1358 u32 **p, int *buflen) 1358 __be32 **p, int *buflen)
1359{ 1359{
1360 int status; 1360 int status;
1361 1361
@@ -1376,20 +1376,20 @@ nfsd4_encode_name(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1376} 1376}
1377 1377
1378static inline int 1378static inline int
1379nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, u32 **p, int *buflen) 1379nfsd4_encode_user(struct svc_rqst *rqstp, uid_t uid, __be32 **p, int *buflen)
1380{ 1380{
1381 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, uid, 0, p, buflen); 1381 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, uid, 0, p, buflen);
1382} 1382}
1383 1383
1384static inline int 1384static inline int
1385nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, u32 **p, int *buflen) 1385nfsd4_encode_group(struct svc_rqst *rqstp, uid_t gid, __be32 **p, int *buflen)
1386{ 1386{
1387 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, gid, 1, p, buflen); 1387 return nfsd4_encode_name(rqstp, NFS4_ACL_WHO_NAMED, gid, 1, p, buflen);
1388} 1388}
1389 1389
1390static inline int 1390static inline int
1391nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group, 1391nfsd4_encode_aclname(struct svc_rqst *rqstp, int whotype, uid_t id, int group,
1392 u32 **p, int *buflen) 1392 __be32 **p, int *buflen)
1393{ 1393{
1394 return nfsd4_encode_name(rqstp, whotype, id, group, p, buflen); 1394 return nfsd4_encode_name(rqstp, whotype, id, group, p, buflen);
1395} 1395}
@@ -1423,7 +1423,7 @@ static int fattr_handle_absent_fs(u32 *bmval0, u32 *bmval1, u32 *rdattr_err)
1423 */ 1423 */
1424int 1424int
1425nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, 1425nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1426 struct dentry *dentry, u32 *buffer, int *countp, u32 *bmval, 1426 struct dentry *dentry, __be32 *buffer, int *countp, u32 *bmval,
1427 struct svc_rqst *rqstp) 1427 struct svc_rqst *rqstp)
1428{ 1428{
1429 u32 bmval0 = bmval[0]; 1429 u32 bmval0 = bmval[0];
@@ -1432,11 +1432,11 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
1432 struct svc_fh tempfh; 1432 struct svc_fh tempfh;
1433 struct kstatfs statfs; 1433 struct kstatfs statfs;
1434 int buflen = *countp << 2; 1434 int buflen = *countp << 2;
1435 u32 *attrlenp; 1435 __be32 *attrlenp;
1436 u32 dummy; 1436 u32 dummy;
1437 u64 dummy64; 1437 u64 dummy64;
1438 u32 rdattr_err = 0; 1438 u32 rdattr_err = 0;
1439 u32 *p = buffer; 1439 __be32 *p = buffer;
1440 int status; 1440 int status;
1441 int aclsupport = 0; 1441 int aclsupport = 0;
1442 struct nfs4_acl *acl = NULL; 1442 struct nfs4_acl *acl = NULL;
@@ -1831,7 +1831,7 @@ out_serverfault:
1831 1831
1832static int 1832static int
1833nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, 1833nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd,
1834 const char *name, int namlen, u32 *p, int *buflen) 1834 const char *name, int namlen, __be32 *p, int *buflen)
1835{ 1835{
1836 struct svc_export *exp = cd->rd_fhp->fh_export; 1836 struct svc_export *exp = cd->rd_fhp->fh_export;
1837 struct dentry *dentry; 1837 struct dentry *dentry;
@@ -1864,10 +1864,10 @@ out_put:
1864 return nfserr; 1864 return nfserr;
1865} 1865}
1866 1866
1867static u32 * 1867static __be32 *
1868nfsd4_encode_rdattr_error(u32 *p, int buflen, int nfserr) 1868nfsd4_encode_rdattr_error(__be32 *p, int buflen, int nfserr)
1869{ 1869{
1870 u32 *attrlenp; 1870 __be32 *attrlenp;
1871 1871
1872 if (buflen < 6) 1872 if (buflen < 6)
1873 return NULL; 1873 return NULL;
@@ -1887,7 +1887,7 @@ nfsd4_encode_dirent(struct readdir_cd *ccd, const char *name, int namlen,
1887{ 1887{
1888 struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common); 1888 struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common);
1889 int buflen; 1889 int buflen;
1890 u32 *p = cd->buffer; 1890 __be32 *p = cd->buffer;
1891 int nfserr = nfserr_toosmall; 1891 int nfserr = nfserr_toosmall;
1892 1892
1893 /* In nfsv4, "." and ".." never make it onto the wire.. */ 1893 /* In nfsv4, "." and ".." never make it onto the wire.. */
@@ -2321,7 +2321,7 @@ nfsd4_encode_readdir(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_re
2321{ 2321{
2322 int maxcount; 2322 int maxcount;
2323 loff_t offset; 2323 loff_t offset;
2324 u32 *page, *savep, *tailbase; 2324 __be32 *page, *savep, *tailbase;
2325 ENCODE_HEAD; 2325 ENCODE_HEAD;
2326 2326
2327 if (nfserr) 2327 if (nfserr)
@@ -2479,7 +2479,7 @@ nfsd4_encode_write(struct nfsd4_compoundres *resp, int nfserr, struct nfsd4_writ
2479void 2479void
2480nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op) 2480nfsd4_encode_operation(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
2481{ 2481{
2482 u32 *statp; 2482 __be32 *statp;
2483 ENCODE_HEAD; 2483 ENCODE_HEAD;
2484 2484
2485 RESERVE_SPACE(8); 2485 RESERVE_SPACE(8);
@@ -2617,7 +2617,7 @@ nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op)
2617 */ 2617 */
2618 2618
2619int 2619int
2620nfs4svc_encode_voidres(struct svc_rqst *rqstp, u32 *p, void *dummy) 2620nfs4svc_encode_voidres(struct svc_rqst *rqstp, __be32 *p, void *dummy)
2621{ 2621{
2622 return xdr_ressize_check(rqstp, p); 2622 return xdr_ressize_check(rqstp, p);
2623} 2623}
@@ -2639,7 +2639,7 @@ void nfsd4_release_compoundargs(struct nfsd4_compoundargs *args)
2639} 2639}
2640 2640
2641int 2641int
2642nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoundargs *args) 2642nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundargs *args)
2643{ 2643{
2644 int status; 2644 int status;
2645 2645
@@ -2660,7 +2660,7 @@ nfs4svc_decode_compoundargs(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoun
2660} 2660}
2661 2661
2662int 2662int
2663nfs4svc_encode_compoundres(struct svc_rqst *rqstp, u32 *p, struct nfsd4_compoundres *resp) 2663nfs4svc_encode_compoundres(struct svc_rqst *rqstp, __be32 *p, struct nfsd4_compoundres *resp)
2664{ 2664{
2665 /* 2665 /*
2666 * All that remains is to write the tag and operation count... 2666 * All that remains is to write the tag and operation count...
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 66e642762a07..003193fe6fc6 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -258,9 +258,9 @@ struct nfsd4_readdir {
258 struct svc_fh * rd_fhp; /* response */ 258 struct svc_fh * rd_fhp; /* response */
259 259
260 struct readdir_cd common; 260 struct readdir_cd common;
261 u32 * buffer; 261 __be32 * buffer;
262 int buflen; 262 int buflen;
263 u32 * offset; 263 __be32 * offset;
264}; 264};
265 265
266struct nfsd4_release_lockowner { 266struct nfsd4_release_lockowner {
@@ -371,12 +371,12 @@ struct nfsd4_op {
371 371
372struct nfsd4_compoundargs { 372struct nfsd4_compoundargs {
373 /* scratch variables for XDR decode */ 373 /* scratch variables for XDR decode */
374 u32 * p; 374 __be32 * p;
375 u32 * end; 375 __be32 * end;
376 struct page ** pagelist; 376 struct page ** pagelist;
377 int pagelen; 377 int pagelen;
378 u32 tmp[8]; 378 __be32 tmp[8];
379 u32 * tmpp; 379 __be32 * tmpp;
380 struct tmpbuf { 380 struct tmpbuf {
381 struct tmpbuf *next; 381 struct tmpbuf *next;
382 void (*release)(const void *); 382 void (*release)(const void *);
@@ -395,15 +395,15 @@ struct nfsd4_compoundargs {
395 395
396struct nfsd4_compoundres { 396struct nfsd4_compoundres {
397 /* scratch variables for XDR encode */ 397 /* scratch variables for XDR encode */
398 u32 * p; 398 __be32 * p;
399 u32 * end; 399 __be32 * end;
400 struct xdr_buf * xbuf; 400 struct xdr_buf * xbuf;
401 struct svc_rqst * rqstp; 401 struct svc_rqst * rqstp;
402 402
403 u32 taglen; 403 u32 taglen;
404 char * tag; 404 char * tag;
405 u32 opcnt; 405 u32 opcnt;
406 u32 * tagp; /* where to encode tag and opcount */ 406 __be32 * tagp; /* where to encode tag and opcount */
407}; 407};
408 408
409#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) 409#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
@@ -419,10 +419,10 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
419 cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; 419 cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec;
420} 420}
421 421
422int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *); 422int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
423int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *, 423int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
424 struct nfsd4_compoundargs *); 424 struct nfsd4_compoundargs *);
425int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *, 425int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
426 struct nfsd4_compoundres *); 426 struct nfsd4_compoundres *);
427void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); 427void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
428void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); 428void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);