From f2252ea822404608c4c8637f92074182bd5ba829 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Sat, 12 Oct 2019 14:17:35 -0500 Subject: [PATCH] afs: Remove ISAFS_GLOCK in afs_ConnBySA 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 Reviewed-by: Cheyenne Wills Reviewed-by: Benjamin Kaduk --- src/afs/afs_conn.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/afs/afs_conn.c b/src/afs/afs_conn.c index 92d36af..ff7c403 100644 --- a/src/afs/afs_conn.c +++ b/src/afs/afs_conn.c @@ -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); } -- 1.9.4