NFSv41: Clean up exclusive create
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Wed, 16 Jun 2010 13:52:27 +0000 (09:52 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 22 Jun 2010 17:24:03 +0000 (13:24 -0400)
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c
include/linux/nfs_xdr.h

index d1ab0c36e939a0fc2f927bda7df5eb1f36b71488..5d87563d0c1a96d0b33a71c4d44801e3237e2267 100644 (file)
@@ -744,19 +744,14 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct path *path,
        p->o_arg.server = server;
        p->o_arg.bitmask = server->attr_bitmask;
        p->o_arg.claim = NFS4_OPEN_CLAIM_NULL;
-       if (flags & O_EXCL) {
-               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) {
+       if (flags & O_CREAT) {
+               u32 *s;
+
                p->o_arg.u.attrs = &p->attrs;
                memcpy(&p->attrs, attrs, sizeof(p->attrs));
+               s = (u32 *) p->o_arg.u.verifier.data;
+               s[0] = jiffies;
+               s[1] = current->pid;
        }
        p->c_arg.fh = &p->o_res.fh;
        p->c_arg.stateid = &p->o_res.stateid;
index 51914d7d6cc4c4f0ab4dd120dd6020f5626a567f..a319cb926abf74ea7b77cd6e030a69391974f529 100644 (file)
@@ -196,8 +196,10 @@ struct nfs_openargs {
        __u64                   clientid;
        __u64                   id;
        union {
-               struct iattr *  attrs;    /* UNCHECKED, GUARDED */
-               nfs4_verifier   verifier; /* EXCLUSIVE */
+               struct {
+                       struct iattr *  attrs;    /* UNCHECKED, GUARDED */
+                       nfs4_verifier   verifier; /* EXCLUSIVE */
+               };
                nfs4_stateid    delegation;             /* CLAIM_DELEGATE_CUR */
                fmode_t         delegation_type;        /* CLAIM_PREVIOUS */
        } u;