diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 01:29:14 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:23 -0400 |
commit | 8c18f2052e756e7d5dea712fc6e7ed70c00e8a39 (patch) | |
tree | 66762e98af4caa4774b8229fb6fd007fccaab74e | |
parent | 7e70570647827345352cf6c17461c9fa166f570a (diff) |
nfsd41: SUPPATTR_EXCLCREAT attribute
Return bitmask for supported EXCLUSIVE4_1 create attributes.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 7 | ||||
-rw-r--r-- | include/linux/nfs4.h | 2 | ||||
-rw-r--r-- | include/linux/nfsd/nfsd.h | 14 |
3 files changed, 21 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 70296fedee41..533d14fec99e 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -2148,7 +2148,12 @@ out_acl: | |||
2148 | } | 2148 | } |
2149 | WRITE64(stat.ino); | 2149 | WRITE64(stat.ino); |
2150 | } | 2150 | } |
2151 | BUG_ON(bmval2); /* FIXME: not implemented yet */ | 2151 | if (bmval2 & FATTR4_WORD2_SUPPATTR_EXCLCREAT) { |
2152 | WRITE32(3); | ||
2153 | WRITE32(NFSD_SUPPATTR_EXCLCREAT_WORD0); | ||
2154 | WRITE32(NFSD_SUPPATTR_EXCLCREAT_WORD1); | ||
2155 | WRITE32(NFSD_SUPPATTR_EXCLCREAT_WORD2); | ||
2156 | } | ||
2152 | 2157 | ||
2153 | *attrlenp = htonl((char *)p - (char *)attrlenp - 4); | 2158 | *attrlenp = htonl((char *)p - (char *)attrlenp - 4); |
2154 | *countp = p - buffer; | 2159 | *countp = p - buffer; |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index 29ed600e193b..ec3cd49b04f5 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -404,6 +404,8 @@ enum lock_type4 { | |||
404 | #define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9) | 404 | #define FATTR4_WORD0_UNIQUE_HANDLES (1UL << 9) |
405 | #define FATTR4_WORD0_LEASE_TIME (1UL << 10) | 405 | #define FATTR4_WORD0_LEASE_TIME (1UL << 10) |
406 | #define FATTR4_WORD0_RDATTR_ERROR (1UL << 11) | 406 | #define FATTR4_WORD0_RDATTR_ERROR (1UL << 11) |
407 | /* Mandatory in NFSv4.1 */ | ||
408 | #define FATTR4_WORD2_SUPPATTR_EXCLCREAT (1UL << 11) | ||
407 | 409 | ||
408 | /* Recommended Attributes */ | 410 | /* Recommended Attributes */ |
409 | #define FATTR4_WORD0_ACL (1UL << 12) | 411 | #define FATTR4_WORD0_ACL (1UL << 12) |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 69ca788f8fc5..0ec4d142c503 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -375,7 +375,7 @@ extern struct timeval nfssvc_boot; | |||
375 | NFSD4_SUPPORTED_ATTRS_WORD1 | 375 | NFSD4_SUPPORTED_ATTRS_WORD1 |
376 | 376 | ||
377 | #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ | 377 | #define NFSD4_1_SUPPORTED_ATTRS_WORD2 \ |
378 | NFSD4_SUPPORTED_ATTRS_WORD2 | 378 | (NFSD4_SUPPORTED_ATTRS_WORD2 | FATTR4_WORD2_SUPPATTR_EXCLCREAT) |
379 | 379 | ||
380 | static inline u32 nfsd_suppattrs0(u32 minorversion) | 380 | static inline u32 nfsd_suppattrs0(u32 minorversion) |
381 | { | 381 | { |
@@ -407,6 +407,18 @@ static inline u32 nfsd_suppattrs2(u32 minorversion) | |||
407 | | 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 | 408 | #define NFSD_WRITEABLE_ATTRS_WORD2 0 |
409 | 409 | ||
410 | #define NFSD_SUPPATTR_EXCLCREAT_WORD0 \ | ||
411 | NFSD_WRITEABLE_ATTRS_WORD0 | ||
412 | /* | ||
413 | * we currently store the exclusive create verifier in the v_{a,m}time | ||
414 | * attributes so the client can't set these at create time using EXCLUSIVE4_1 | ||
415 | */ | ||
416 | #define NFSD_SUPPATTR_EXCLCREAT_WORD1 \ | ||
417 | (NFSD_WRITEABLE_ATTRS_WORD1 & \ | ||
418 | ~(FATTR4_WORD1_TIME_ACCESS_SET | FATTR4_WORD1_TIME_MODIFY_SET)) | ||
419 | #define NFSD_SUPPATTR_EXCLCREAT_WORD2 \ | ||
420 | NFSD_WRITEABLE_ATTRS_WORD2 | ||
421 | |||
410 | #endif /* CONFIG_NFSD_V4 */ | 422 | #endif /* CONFIG_NFSD_V4 */ |
411 | 423 | ||
412 | #endif /* LINUX_NFSD_NFSD_H */ | 424 | #endif /* LINUX_NFSD_NFSD_H */ |