diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-03 01:29:17 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:23 -0400 |
commit | 79fb54abd285b442e1f30f851902f3ddf58e7704 (patch) | |
tree | 93c8278368e7f6328e1cfa695ce96d5c95f3e338 /include/linux | |
parent | 8c18f2052e756e7d5dea712fc6e7ed70c00e8a39 (diff) |
nfsd41: CREATE_EXCLUSIVE4_1
Implement the CREATE_EXCLUSIVE4_1 open mode conforming to
http://tools.ietf.org/html/draft-ietf-nfsv4-minorversion1-26
This mode allows the client to atomically create a file
if it doesn't exist while setting some of its attributes.
It must be implemented if the server supports persistent
reply cache and/or pnfs.
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/nfs4.h | 8 | ||||
-rw-r--r-- | include/linux/nfsd/xdr4.h | 10 |
2 files changed, 11 insertions, 7 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index ec3cd49b04f5..e3f0cbcbd0db 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -368,7 +368,13 @@ enum opentype4 { | |||
368 | enum createmode4 { | 368 | enum createmode4 { |
369 | NFS4_CREATE_UNCHECKED = 0, | 369 | NFS4_CREATE_UNCHECKED = 0, |
370 | NFS4_CREATE_GUARDED = 1, | 370 | NFS4_CREATE_GUARDED = 1, |
371 | NFS4_CREATE_EXCLUSIVE = 2 | 371 | NFS4_CREATE_EXCLUSIVE = 2, |
372 | /* | ||
373 | * New to NFSv4.1. If session is persistent, | ||
374 | * GUARDED4 MUST be used. Otherwise, use | ||
375 | * EXCLUSIVE4_1 instead of EXCLUSIVE4. | ||
376 | */ | ||
377 | NFS4_CREATE_EXCLUSIVE4_1 = 3 | ||
372 | }; | 378 | }; |
373 | 379 | ||
374 | enum limit_by4 { | 380 | enum limit_by4 { |
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index c07d8fe7bb07..f80d6013fdc3 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -219,10 +219,8 @@ struct nfsd4_open { | |||
219 | u32 op_create; /* request */ | 219 | u32 op_create; /* request */ |
220 | u32 op_createmode; /* request */ | 220 | u32 op_createmode; /* request */ |
221 | u32 op_bmval[3]; /* request */ | 221 | u32 op_bmval[3]; /* request */ |
222 | union { /* request */ | 222 | struct iattr iattr; /* UNCHECKED4, GUARDED4, EXCLUSIVE4_1 */ |
223 | struct iattr iattr; /* UNCHECKED4,GUARDED4 */ | 223 | nfs4_verifier verf; /* EXCLUSIVE4 */ |
224 | nfs4_verifier verf; /* EXCLUSIVE4 */ | ||
225 | } u; | ||
226 | clientid_t op_clientid; /* request */ | 224 | clientid_t op_clientid; /* request */ |
227 | struct xdr_netobj op_owner; /* request */ | 225 | struct xdr_netobj op_owner; /* request */ |
228 | u32 op_seqid; /* request */ | 226 | u32 op_seqid; /* request */ |
@@ -236,8 +234,8 @@ struct nfsd4_open { | |||
236 | struct nfs4_stateowner *op_stateowner; /* used during processing */ | 234 | struct nfs4_stateowner *op_stateowner; /* used during processing */ |
237 | struct nfs4_acl *op_acl; | 235 | struct nfs4_acl *op_acl; |
238 | }; | 236 | }; |
239 | #define op_iattr u.iattr | 237 | #define op_iattr iattr |
240 | #define op_verf u.verf | 238 | #define op_verf verf |
241 | 239 | ||
242 | struct nfsd4_open_confirm { | 240 | struct nfsd4_open_confirm { |
243 | stateid_t oc_req_stateid /* request */; | 241 | stateid_t oc_req_stateid /* request */; |