]> git.hungrycats.org Git - linux/commitdiff
[PATCH] nfsd4: move seqid decrement on reclaim to separate function
authorNeil Brown <neilb@cse.unsw.edu.au>
Wed, 20 Oct 2004 01:26:23 +0000 (18:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 20 Oct 2004 01:26:23 +0000 (18:26 -0700)
Move seqid decrement on reclaim to separate function

Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfsd/nfs4state.c

index b217d554d247a091f4c9495cc9678299589e096e..330883814828a315c399b92ae2c07d0afd4f483a 100644 (file)
@@ -1275,6 +1275,20 @@ out:
        return status;
 }
 
+/* decrement seqid on successful reclaim, it will be bumped in encode_open */
+static void
+nfs4_set_claim_prev(struct nfsd4_open *open, int *status)
+{
+       if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) {
+               if (*status)
+                       *status = nfserr_reclaim_bad;
+               else {
+                       open->op_stateowner->so_confirmed = 1;
+                       open->op_stateowner->so_seqid--;
+               }
+       }
+}
+
 /*
  * called with nfs4_lock_state() held.
  */
@@ -1370,17 +1384,8 @@ out:
        if (fp && list_empty(&fp->fi_perfile))
                release_file(fp);
 
-       if (open->op_claim_type == NFS4_OPEN_CLAIM_PREVIOUS) {
-               if (status)
-                       status = nfserr_reclaim_bad;
-               else {
-               /* successful reclaim. so_seqid is decremented because
-               * it will be bumped in encode_open
-               */
-                       open->op_stateowner->so_confirmed = 1;
-                       open->op_stateowner->so_seqid--;
-               }
-       }
+       /* CLAIM_PREVIOUS has different error returns */
+       nfs4_set_claim_prev(open, &status);
        /*
        * To finish the open response, we just need to set the rflags.
        */