NFSD: Clean up switch statement in nfsd_dispatch()
authorChuck Lever <chuck.lever@oracle.com>
Thu, 1 Oct 2020 22:59:18 +0000 (18:59 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 2 Oct 2020 13:37:41 +0000 (09:37 -0400)
Reorder the arms so the compiler places checks for the most frequent
case first.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfssvc.c

index b2d2092..3cdefb2 100644 (file)
@@ -1030,12 +1030,12 @@ nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp)
 
        /* Check whether we have this call in the cache. */
        switch (nfsd_cache_lookup(rqstp)) {
-       case RC_DROPIT:
-               return 0;
+       case RC_DOIT:
+               break;
        case RC_REPLY:
                return 1;
-       case RC_DOIT:;
-               /* do it */
+       case RC_DROPIT:
+               return 0;
        }
 
        /* need to grab the location to store the status, as