aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2010-06-16 09:52:27 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2010-06-22 13:24:03 -0400
commitd77d76ffb638bd013782138cca6d8f4918c5afd6 (patch)
tree42a05f3a926498d8c0fd7a766ec484c8da22789e
parenta4432345352c2be157ed844603147ac2c82f209c (diff)
NFSv41: Clean up exclusive create
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/nfs4proc.c17
-rw-r--r--include/linux/nfs_xdr.h6
2 files changed, 10 insertions, 13 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d1ab0c36e939..5d87563d0c1a 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -744,19 +744,14 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
744 p->o_arg.server = server; 744 p->o_arg.server = server;
745 p->o_arg.bitmask = server->attr_bitmask; 745 p->o_arg.bitmask = server->attr_bitmask;
746 p->o_arg.claim = NFS4_OPEN_CLAIM_NULL; 746 p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
747 if (flags & O_EXCL) { 747 if (flags & O_CREAT) {
748 if (nfs4_has_persistent_session(server->nfs_client)) { 748 u32 *s;
749 /* GUARDED */ 749
750 p->o_arg.u.attrs = &p->attrs;
751 memcpy(&p->attrs, attrs, sizeof(p->attrs));
752 } else { /* EXCLUSIVE4_1 */
753 u32 *s = (u32 *) p->o_arg.u.verifier.data;
754 s[0] = jiffies;
755 s[1] = current->pid;
756 }
757 } else if (flags & O_CREAT) {
758 p->o_arg.u.attrs = &p->attrs; 750 p->o_arg.u.attrs = &p->attrs;
759 memcpy(&p->attrs, attrs, sizeof(p->attrs)); 751 memcpy(&p->attrs, attrs, sizeof(p->attrs));
752 s = (u32 *) p->o_arg.u.verifier.data;
753 s[0] = jiffies;
754 s[1] = current->pid;
760 } 755 }
761 p->c_arg.fh = &p->o_res.fh; 756 p->c_arg.fh = &p->o_res.fh;
762 p->c_arg.stateid = &p->o_res.stateid; 757 p->c_arg.stateid = &p->o_res.stateid;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 51914d7d6cc4..a319cb926abf 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -196,8 +196,10 @@ struct nfs_openargs {
196 __u64 clientid; 196 __u64 clientid;
197 __u64 id; 197 __u64 id;
198 union { 198 union {
199 struct iattr * attrs; /* UNCHECKED, GUARDED */ 199 struct {
200 nfs4_verifier verifier; /* EXCLUSIVE */ 200 struct iattr * attrs; /* UNCHECKED, GUARDED */
201 nfs4_verifier verifier; /* EXCLUSIVE */
202 };
201 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */ 203 nfs4_stateid delegation; /* CLAIM_DELEGATE_CUR */
202 fmode_t delegation_type; /* CLAIM_PREVIOUS */ 204 fmode_t delegation_type; /* CLAIM_PREVIOUS */
203 } u; 205 } u;