nfs41: add support for the exclusive create flags
In v4.1 the client MUST/SHOULD use the EXCLUSIVE4_1 flag instead of EXCLUSIVE4, and GUARDED when the server supports persistent sessions. For now (and until we support suppattr_exclcreat), we don't send any attributes with EXCLUSIVE4_1 relying in the subsequent SETATTR as in v4.0 Signed-off-by: Alexandros Batsakis <batsakis@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
committed by
Trond Myklebust
parent
d8cb1a7ce3
commit
4882ef72cd
@@ -726,9 +726,15 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
|
||||
p->o_arg.bitmask = server->attr_bitmask;
|
||||
p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
|
||||
if (flags & O_EXCL) {
|
||||
u32 *s = (u32 *) p->o_arg.u.verifier.data;
|
||||
s[0] = jiffies;
|
||||
s[1] = current->pid;
|
||||
if (nfs4_has_persistent_session(server->nfs_client)) {
|
||||
/* GUARDED */
|
||||
p->o_arg.u.attrs = &p->attrs;
|
||||
memcpy(&p->attrs, attrs, sizeof(p->attrs));
|
||||
} else { /* EXCLUSIVE4_1 */
|
||||
u32 *s = (u32 *) p->o_arg.u.verifier.data;
|
||||
s[0] = jiffies;
|
||||
s[1] = current->pid;
|
||||
}
|
||||
} else if (flags & O_CREAT) {
|
||||
p->o_arg.u.attrs = &p->attrs;
|
||||
memcpy(&p->attrs, attrs, sizeof(p->attrs));
|
||||
|
Reference in New Issue
Block a user