afs: Remove ISAFS_GLOCK in afs_ConnBySA 81/14581/2
authorAndrew Deason <adeason@sinenomine.net>
Sat, 12 Oct 2019 19:17:35 +0000 (14:17 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 9 Apr 2021 15:38:43 +0000 (11:38 -0400)
We must be holding AFS_GLOCK at this point in the code, since we're
calling functions like ObtainSharedLock, which require AFS_GLOCK to be
held. Remove the call to ISAFS_GLOCK and the relevant conditionals, to
get rid of some visual noise.

The call to ISAFS_GLOCK was added in commit cb9e0292 (unix cm
rx-oblivious connection pooling), in which it was also unnecessary.

Change-Id: I9281108453359acf079828c1625556e2380c3a51
Reviewed-on: https://gerrit.openafs.org/14581
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>

src/afs/afs_conn.c

index 92d36af..ff7c403 100644 (file)
@@ -385,7 +385,7 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
             afs_int32 locktype, afs_int32 replicated,
             struct rx_connection **rxconn)
 {
-    int glocked, foundvec;
+    int foundvec;
     struct afs_conn *tc = NULL;
     struct sa_conn_vector *tcv = NULL;
     struct rx_securityClass *csec; /*Security class object */
@@ -486,18 +486,15 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
        tu->states &= ~UHasTokens;      /* remove the authentication info */
     }
 
-    glocked = ISAFS_GLOCK();
     if (tc->forceConnectFS) {
        UpgradeSToWLock(&afs_xconn, 38);
        if (tc->id) {
            if (sap->natping == tc)
                sap->natping = NULL;
-           if (glocked)
-                AFS_GUNLOCK();
+           AFS_GUNLOCK();
             rx_SetConnSecondsUntilNatPing(tc->id, 0);
             rx_DestroyConnection(tc->id);
-           if (glocked)
-                AFS_GLOCK();
+           AFS_GLOCK();
        }
        /*
         * Stupid hack to determine if using vldb service or file system
@@ -511,11 +508,9 @@ afs_ConnBySA(struct srvAddr *sap, unsigned short aport, afs_int32 acell,
 
        csec = afs_pickSecurityObject(tc, &isec);
 
-       if (glocked)
-            AFS_GUNLOCK();
+       AFS_GUNLOCK();
        tc->id = rx_NewConnection(sap->sa_ip, aport, service, csec, isec);
-       if (glocked)
-            AFS_GLOCK();
+       AFS_GLOCK();
        if (service == 52) {
            rx_SetConnHardDeadTime(tc->id, afs_rx_harddead);
        }