aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-04-03 01:29:11 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-03 20:41:23 -0400
commit7e70570647827345352cf6c17461c9fa166f570a (patch)
treea200662bb68cd9a1396c365a47b50e46f0ea9f73 /include/linux
parent95ec28cda323104bbff64fc7ec8ee4c9042e51fa (diff)
nfsd41: support for 3-word long attribute bitmask
Also, use client minorversion to generate supported attrs Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfsd/nfsd.h34
-rw-r--r--include/linux/nfsd/xdr4.h12
2 files changed, 38 insertions, 8 deletions
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 5bed5096874d..69ca788f8fc5 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -346,7 +346,7 @@ extern struct timeval nfssvc_boot;
346 * TIME_BACKUP (unlikely to be supported any time soon) 346 * TIME_BACKUP (unlikely to be supported any time soon)
347 * TIME_CREATE (unlikely to be supported any time soon) 347 * TIME_CREATE (unlikely to be supported any time soon)
348 */ 348 */
349#define NFSD_SUPPORTED_ATTRS_WORD0 \ 349#define NFSD4_SUPPORTED_ATTRS_WORD0 \
350(FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \ 350(FATTR4_WORD0_SUPPORTED_ATTRS | FATTR4_WORD0_TYPE | FATTR4_WORD0_FH_EXPIRE_TYPE \
351 | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \ 351 | FATTR4_WORD0_CHANGE | FATTR4_WORD0_SIZE | FATTR4_WORD0_LINK_SUPPORT \
352 | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \ 352 | FATTR4_WORD0_SYMLINK_SUPPORT | FATTR4_WORD0_NAMED_ATTR | FATTR4_WORD0_FSID \
@@ -358,7 +358,7 @@ extern struct timeval nfssvc_boot;
358 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ 358 | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \
359 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) 359 | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL)
360 360
361#define NFSD_SUPPORTED_ATTRS_WORD1 \ 361#define NFSD4_SUPPORTED_ATTRS_WORD1 \
362(FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \ 362(FATTR4_WORD1_MODE | FATTR4_WORD1_NO_TRUNC | FATTR4_WORD1_NUMLINKS \
363 | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \ 363 | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \
364 | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \ 364 | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \
@@ -366,6 +366,35 @@ extern struct timeval nfssvc_boot;
366 | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \ 366 | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \
367 | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID) 367 | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID)
368 368
369#define NFSD4_SUPPORTED_ATTRS_WORD2 0
370
371#define NFSD4_1_SUPPORTED_ATTRS_WORD0 \
372 NFSD4_SUPPORTED_ATTRS_WORD0
373
374#define NFSD4_1_SUPPORTED_ATTRS_WORD1 \
375 NFSD4_SUPPORTED_ATTRS_WORD1
376
377#define NFSD4_1_SUPPORTED_ATTRS_WORD2 \
378 NFSD4_SUPPORTED_ATTRS_WORD2
379
380static inline u32 nfsd_suppattrs0(u32 minorversion)
381{
382 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD0
383 : NFSD4_SUPPORTED_ATTRS_WORD0;
384}
385
386static inline u32 nfsd_suppattrs1(u32 minorversion)
387{
388 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD1
389 : NFSD4_SUPPORTED_ATTRS_WORD1;
390}
391
392static inline u32 nfsd_suppattrs2(u32 minorversion)
393{
394 return minorversion ? NFSD4_1_SUPPORTED_ATTRS_WORD2
395 : NFSD4_SUPPORTED_ATTRS_WORD2;
396}
397
369/* These will return ERR_INVAL if specified in GETATTR or READDIR. */ 398/* These will return ERR_INVAL if specified in GETATTR or READDIR. */
370#define NFSD_WRITEONLY_ATTRS_WORD1 \ 399#define NFSD_WRITEONLY_ATTRS_WORD1 \
371(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) 400(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
@@ -376,6 +405,7 @@ extern struct timeval nfssvc_boot;
376#define NFSD_WRITEABLE_ATTRS_WORD1 \ 405#define NFSD_WRITEABLE_ATTRS_WORD1 \
377(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \ 406(FATTR4_WORD1_MODE | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP \
378 | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET) 407 | FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)
408#define NFSD_WRITEABLE_ATTRS_WORD2 0
379 409
380#endif /* CONFIG_NFSD_V4 */ 410#endif /* CONFIG_NFSD_V4 */
381 411
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 5e16935a1eaf..c07d8fe7bb07 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -102,7 +102,7 @@ struct nfsd4_create {
102 u32 specdata2; 102 u32 specdata2;
103 } dev; /* NF4BLK, NF4CHR */ 103 } dev; /* NF4BLK, NF4CHR */
104 } u; 104 } u;
105 u32 cr_bmval[2]; /* request */ 105 u32 cr_bmval[3]; /* request */
106 struct iattr cr_iattr; /* request */ 106 struct iattr cr_iattr; /* request */
107 struct nfsd4_change_info cr_cinfo; /* response */ 107 struct nfsd4_change_info cr_cinfo; /* response */
108 struct nfs4_acl *cr_acl; 108 struct nfs4_acl *cr_acl;
@@ -117,7 +117,7 @@ struct nfsd4_delegreturn {
117}; 117};
118 118
119struct nfsd4_getattr { 119struct nfsd4_getattr {
120 u32 ga_bmval[2]; /* request */ 120 u32 ga_bmval[3]; /* request */
121 struct svc_fh *ga_fhp; /* response */ 121 struct svc_fh *ga_fhp; /* response */
122}; 122};
123 123
@@ -218,7 +218,7 @@ struct nfsd4_open {
218 stateid_t op_delegate_stateid; /* request - response */ 218 stateid_t op_delegate_stateid; /* request - response */
219 u32 op_create; /* request */ 219 u32 op_create; /* request */
220 u32 op_createmode; /* request */ 220 u32 op_createmode; /* request */
221 u32 op_bmval[2]; /* request */ 221 u32 op_bmval[3]; /* request */
222 union { /* request */ 222 union { /* request */
223 struct iattr iattr; /* UNCHECKED4,GUARDED4 */ 223 struct iattr iattr; /* UNCHECKED4,GUARDED4 */
224 nfs4_verifier verf; /* EXCLUSIVE4 */ 224 nfs4_verifier verf; /* EXCLUSIVE4 */
@@ -271,7 +271,7 @@ struct nfsd4_readdir {
271 nfs4_verifier rd_verf; /* request */ 271 nfs4_verifier rd_verf; /* request */
272 u32 rd_dircount; /* request */ 272 u32 rd_dircount; /* request */
273 u32 rd_maxcount; /* request */ 273 u32 rd_maxcount; /* request */
274 u32 rd_bmval[2]; /* request */ 274 u32 rd_bmval[3]; /* request */
275 struct svc_rqst *rd_rqstp; /* response */ 275 struct svc_rqst *rd_rqstp; /* response */
276 struct svc_fh * rd_fhp; /* response */ 276 struct svc_fh * rd_fhp; /* response */
277 277
@@ -313,7 +313,7 @@ struct nfsd4_secinfo {
313 313
314struct nfsd4_setattr { 314struct nfsd4_setattr {
315 stateid_t sa_stateid; /* request */ 315 stateid_t sa_stateid; /* request */
316 u32 sa_bmval[2]; /* request */ 316 u32 sa_bmval[3]; /* request */
317 struct iattr sa_iattr; /* request */ 317 struct iattr sa_iattr; /* request */
318 struct nfs4_acl *sa_acl; 318 struct nfs4_acl *sa_acl;
319}; 319};
@@ -339,7 +339,7 @@ struct nfsd4_setclientid_confirm {
339 339
340/* also used for NVERIFY */ 340/* also used for NVERIFY */
341struct nfsd4_verify { 341struct nfsd4_verify {
342 u32 ve_bmval[2]; /* request */ 342 u32 ve_bmval[3]; /* request */
343 u32 ve_attrlen; /* request */ 343 u32 ve_attrlen; /* request */
344 char * ve_attrval; /* request */ 344 char * ve_attrval; /* request */
345}; 345};