Commit d77d76ff authored by Trond Myklebust's avatar Trond Myklebust

NFSv41: Clean up exclusive create

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent a4432345
...@@ -744,20 +744,15 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path, ...@@ -744,20 +744,15 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
p->o_arg.server = server; p->o_arg.server = server;
p->o_arg.bitmask = server->attr_bitmask; p->o_arg.bitmask = server->attr_bitmask;
p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
if (flags & O_EXCL) { if (flags & O_CREAT) {
if (nfs4_has_persistent_session(server->nfs_client)) { u32 *s;
/* GUARDED */
p->o_arg.u.attrs = &p->attrs; p->o_arg.u.attrs = &p->attrs;
memcpy(&p->attrs, attrs, sizeof(p->attrs)); memcpy(&p->attrs, attrs, sizeof(p->attrs));
} else { /* EXCLUSIVE4_1 */ s = (u32 *) p->o_arg.u.verifier.data;
u32 *s = (u32 *) p->o_arg.u.verifier.data;
s[0] = jiffies; s[0] = jiffies;
s[1] = current->pid; s[1] = current->pid;
} }
} else if (flags & O_CREAT) {
p->o_arg.u.attrs = &p->attrs;
memcpy(&p->attrs, attrs, sizeof(p->attrs));
}
p->c_arg.fh = &p->o_res.fh; p->c_arg.fh = &p->o_res.fh;
p->c_arg.stateid = &p->o_res.stateid; p->c_arg.stateid = &p->o_res.stateid;
p->c_arg.seqid = p->o_arg.seqid; p->c_arg.seqid = p->o_arg.seqid;
......
...@@ -196,8 +196,10 @@ struct nfs_openargs { ...@@ -196,8 +196,10 @@ struct nfs_openargs {
__u64 clientid; __u64 clientid;
__u64 id; __u64 id;
union { union {
struct {
struct iattr * attrs; /* UNCHECKED, GUARDED */ struct iattr * attrs; /* UNCHECKED, GUARDED */
nfs4_verifier verifier; /* EXCLUSIVE */ nfs4_verifier verifier; /* EXCLUSIVE */
};
nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
fmode_t delegation_type; /* CLAIM_PREVIOUS */ fmode_t delegation_type; /* CLAIM_PREVIOUS */
} u; } u;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment