]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
nfsd4: simplify check_open logic
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 2 Sep 2011 16:08:20 +0000 (12:08 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 2 Sep 2011 23:59:29 +0000 (19:59 -0400)
Sometimes the single-exit style is good, sometimes it's unnecessarily
convoluted....

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c

index 8edc9ad63ea606f8e69d5bdb21ee2f2d43d6b630..8694e60a45208e0eb9de4d26aa78a0e04d699d7f 100644 (file)
@@ -2573,7 +2573,6 @@ static __be32
 nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_stateid **stpp)
 {
        struct nfs4_stateid *local;
-       __be32 status = nfserr_share_denied;
        struct nfs4_stateowner *sop = open->op_stateowner;
 
        list_for_each_entry(local, &fp->fi_stateids, st_perfile) {
@@ -2585,11 +2584,9 @@ nfs4_check_open(struct nfs4_file *fp, struct nfsd4_open *open, struct nfs4_state
                        *stpp = local;
                /* check for conflicting share reservations */
                if (!test_share(local, open))
-                       goto out;
+                       return nfserr_share_denied;
        }
-       status = 0;
-out:
-       return status;
+       return nfs_ok;
 }
 
 static inline struct nfs4_stateid *