afs-rx-enable-locks-cleanup-20020228
authorNathan Neulinger <nneul@umr.edu>
Thu, 28 Feb 2002 06:08:10 +0000 (06:08 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 28 Feb 2002 06:08:10 +0000 (06:08 +0000)
use RX_AFS_GLOCK macros instead of ifdef wrappers

src/afs/afs_analyze.c
src/afs/afs_callback.c
src/afs/afs_memcache.c
src/afs/afs_pioctl.c
src/afs/afs_segments.c
src/afs/afs_server.c
src/afs/afs_vcache.c
src/afs/afs_volume.c

index ae16db2..838a45c 100644 (file)
@@ -183,51 +183,31 @@ static int VLDB_Same (afid, areq)
        if (tconn) {
            if (tconn->srvr->server->flags & SNO_LHOSTS) {
                type = 0;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                i = VL_GetEntryByNameO(tconn->id, bp, &v.tve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
            } else if (tconn->srvr->server->flags & SYES_LHOSTS) {
                type = 1;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                i = VL_GetEntryByNameN(tconn->id, bp, &v.ntve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
            } else {
                type = 2;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                i = VL_GetEntryByNameU(tconn->id, bp, &v.utve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
                if (!(tconn->srvr->server->flags & SVLSRV_UUID)) {
                    if (i == RXGEN_OPCODE) {
                        type = 1;
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GUNLOCK();
                         i = VL_GetEntryByNameN(tconn->id, bp, &v.ntve);
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GLOCK();
                        if (i == RXGEN_OPCODE) {
                            type = 0;
                            tconn->srvr->server->flags |= SNO_LHOSTS;
-#ifdef RX_ENABLE_LOCKS
-                           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                           RX_AFS_GUNLOCK();
                            i = VL_GetEntryByNameO(tconn->id, bp, &v.tve);
-#ifdef RX_ENABLE_LOCKS
-                           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                           RX_AFS_GLOCK();
                        } else if (!i)
                            tconn->srvr->server->flags |= SYES_LHOSTS;
                    } else if (!i)
index b969046..69a010b 100644 (file)
@@ -109,9 +109,7 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result)
     int code;                          /*Return code*/
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETCE);
 
@@ -174,9 +172,7 @@ int SRXAFSCB_GetCE(a_call, a_index, a_result)
 fcnDone:
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(code);
 
@@ -194,9 +190,7 @@ int SRXAFSCB_GetCE64(a_call, a_index, a_result)
     int code;                          /*Return code*/
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETCE);
 
@@ -264,9 +258,7 @@ int SRXAFSCB_GetCE64(a_call, a_index, a_result)
 fcnDone:
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(code);
 
@@ -309,9 +301,7 @@ int SRXAFSCB_GetLock (a_call, a_index, a_result)
     int code;                  /*Return code*/
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETLOCK);
     
@@ -347,9 +337,7 @@ int SRXAFSCB_GetLock (a_call, a_index, a_result)
 
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(code);
 
@@ -529,9 +517,7 @@ int SRXAFSCB_CallBack(a_call, a_fids, a_callbacks)
     int code=0;
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_CALLBACK);
 
@@ -548,9 +534,7 @@ int SRXAFSCB_CallBack(a_call, a_fids, a_callbacks)
 
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
     
     return(0);
 
@@ -585,17 +569,13 @@ int SRXAFSCB_Probe(a_call)
     int code = 0;
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_Probe);
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_PROBE);
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(0);
 
@@ -636,9 +616,7 @@ int SRXAFSCB_InitCallBackState(a_call)
     extern int osi_dnlc_purge();
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_INITCALLBACKSTATE);
     AFS_STATCNT(SRXAFSCB_InitCallBackState);
@@ -685,9 +663,7 @@ int SRXAFSCB_InitCallBackState(a_call)
 
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(0);
 
@@ -724,18 +700,14 @@ int SRXAFSCB_XStatsVersion(a_call, a_versionP)
 
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_XSTATSVERSION);
 
     *a_versionP = AFSCB_XSTAT_VERSION;
 
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(0);
 }  /*SRXAFSCB_XStatsVersion*/
@@ -783,9 +755,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
     afs_int32 dataBytes;               /*Bytes in data buffer*/
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_GETXSTATS);
 
@@ -879,9 +849,7 @@ int SRXAFSCB_GetXStats(a_call, a_clientVersionNum, a_collectionNumber, a_srvVers
 
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return(code);
 
@@ -1022,9 +990,7 @@ struct interfaceAddr *addr;
     int code = 0;
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
 
     AFS_STATCNT(SRXAFSCB_WhoAreYou);
 
@@ -1041,9 +1007,7 @@ struct interfaceAddr *addr;
 
     ReleaseReadLock(&afs_xinterface);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return code;
 }
@@ -1114,9 +1078,7 @@ afsUUID *a_uuid;
     int code = 0;
     XSTATS_DECLS;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_Probe);
 
     XSTATS_START_CMTIME(AFS_STATS_CM_RPCIDX_PROBE);
@@ -1124,9 +1086,7 @@ afsUUID *a_uuid;
        code = 1; /* failure */
     XSTATS_END_TIME;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return code;
 }
@@ -1164,9 +1124,7 @@ int SRXAFSCB_GetServerPrefs(
     int i, j;
     struct srvAddr *sa;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_GetServerPrefs);
 
     ObtainReadLock(&afs_xserver);
@@ -1185,9 +1143,7 @@ int SRXAFSCB_GetServerPrefs(
 
     ReleaseReadLock(&afs_xserver);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return 0;
 }
@@ -1226,9 +1182,7 @@ int SRXAFSCB_GetCellServDB(
     struct afs_q *cq, *tq;
     char *t_name, *p_name = NULL;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_GetCellServDB);
 
     memset(a_hosts, 0, AFSMAXCELLHOSTS * sizeof(afs_int32));
@@ -1252,9 +1206,7 @@ int SRXAFSCB_GetCellServDB(
        i = 0;
     t_name = (char *)rxi_Alloc(i+1);
     if (t_name == NULL) {
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        return ENOMEM;
     }
 
@@ -1264,9 +1216,7 @@ int SRXAFSCB_GetCellServDB(
 
     ReleaseReadLock(&afs_xcell);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     *a_name = t_name;
     return 0;
@@ -1302,9 +1252,7 @@ int SRXAFSCB_GetLocalCell(
     struct afs_q *cq, *tq;
     char *t_name, *p_name = NULL;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_GetLocalCell);
 
     /* Search the list for the primary cell. Cell number 1 is only
@@ -1329,9 +1277,7 @@ int SRXAFSCB_GetLocalCell(
        plen = 0;
     t_name = (char *)rxi_Alloc(plen+1);
     if (t_name == NULL) {
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        return ENOMEM;
     }
 
@@ -1341,9 +1287,7 @@ int SRXAFSCB_GetLocalCell(
 
     ReleaseReadLock(&afs_xcell);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     *a_name = t_name;
     return 0;
@@ -1423,9 +1367,7 @@ int SRXAFSCB_GetCacheConfig(
     size_t allocsize;
     cm_initparams_v1 cm_config;
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     AFS_STATCNT(SRXAFSCB_GetCacheConfig);
 
     /*
@@ -1434,9 +1376,7 @@ int SRXAFSCB_GetCacheConfig(
     allocsize = sizeof(cm_initparams_v1);
     t_config = (afs_uint32 *)rxi_Alloc(allocsize);
     if (t_config == NULL) {
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        return ENOMEM;
     }
 
@@ -1457,9 +1397,7 @@ int SRXAFSCB_GetCacheConfig(
     config->cacheConfig_val = t_config;
     config->cacheConfig_len = allocsize/sizeof(afs_uint32);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
 
     return 0;
 }
index ab176da..f99166a 100644 (file)
@@ -394,13 +394,9 @@ afs_MemCacheStoreProc(acall, mceP, alen, avc, shouldWake, abytesToXferP, abytesX
       
       while (alen > 0) {
          tlen = (alen > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : alen);
-#ifdef RX_ENABLE_LOCKS
-          AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+          RX_AFS_GUNLOCK();
          code = rx_WritevAlloc(acall, tiov, &tnio, RX_MAXIOVECS, tlen);
-#ifdef RX_ENABLE_LOCKS
-          AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+          RX_AFS_GLOCK();
          if (code <= 0) {
              osi_FreeSmallSpace(tiov);
              return -33;
@@ -411,13 +407,9 @@ afs_MemCacheStoreProc(acall, mceP, alen, avc, shouldWake, abytesToXferP, abytesX
              osi_FreeSmallSpace(tiov);
              return -33;
          }
-#ifdef RX_ENABLE_LOCKS
-          AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+          RX_AFS_GUNLOCK();
          code = rx_Writev(acall, tiov, tnio, tlen);
-#ifdef RX_ENABLE_LOCKS
-          AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+          RX_AFS_GLOCK();
 #ifndef AFS_NOSTATS
          (*abytesXferredP) += code;
 #endif /* AFS_NOSTATS */
@@ -475,14 +467,10 @@ afs_MemCacheFetchProc(acall, mceP, abase, adc, avc, abytesToXferP, abytesXferred
       }
       do {
          if (moredata) {
-#ifdef RX_ENABLE_LOCKS
-              AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+              RX_AFS_GUNLOCK();
              code = rx_Read(acall, (char *)&length, sizeof(afs_int32));
              length = ntohl(length);
-#ifdef RX_ENABLE_LOCKS
-              AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+              RX_AFS_GLOCK();
              if (code != sizeof(afs_int32)) {
                  code = rx_Error(acall);
                  osi_FreeSmallSpace(tiov);
@@ -509,13 +497,9 @@ afs_MemCacheFetchProc(acall, mceP, abase, adc, avc, abytesToXferP, abytesXferred
 #endif                         /* AFS_NOSTATS */
          while (length > 0) {
              tlen = (length > AFS_LRALLOCSIZ? AFS_LRALLOCSIZ : length);
-#ifdef RX_ENABLE_LOCKS
-              AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+              RX_AFS_GUNLOCK();
              code = rx_Readv(acall, tiov, &tnio, RX_MAXIOVECS, tlen);
-#ifdef RX_ENABLE_LOCKS
-              AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+              RX_AFS_GLOCK();
 #ifndef AFS_NOSTATS
              (*abytesXferredP) += code;
 #endif                         /* AFS_NOSTATS */
index 4871963..e714562 100644 (file)
@@ -1140,14 +1140,10 @@ static PSetAcl(avc, afun, areq, ain, aout, ainSize, aoutSize)
       tconn = afs_Conn(&avc->fid, areq, SHARED_LOCK);
       if (tconn) {
        XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STOREACL);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        code = RXAFS_StoreACL(tconn->id, (struct AFSFid *) &avc->fid.Fid,
                              &acl, &OutStatus, &tsync);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GLOCK();
        XSTATS_END_TIME;
       }
       else code = -1;
@@ -1258,14 +1254,10 @@ static PGCPAGs(avc, afun, areq, ain, aout, ainSize, aoutSize, acred)
       if (tconn) {
        *aout = 0;
        XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHACL);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        code = RXAFS_FetchACL(tconn->id, &Fid,
                              &acl, &OutStatus, &tsync);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GLOCK();
        XSTATS_END_TIME;
       }
       else code = -1;
@@ -1532,14 +1524,10 @@ static PGetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
       tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
       if (tc) {
        XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETVOLUMESTATUS);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GUNLOCK();
        code = RXAFS_GetVolumeStatus(tc->id, avc->fid.Fid.Volume, &volstat,
                                     &Name, &OfflineMsg, &MOTD);
-#ifdef RX_ENABLE_LOCKS
-       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+       RX_AFS_GLOCK();
        XSTATS_END_TIME;
       }
       else code = -1;
@@ -1621,14 +1609,10 @@ static PSetVolumeStatus(avc, afun, areq, ain, aout, ainSize, aoutSize)
        tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
        if (tc) {
           XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_SETVOLUMESTATUS);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
            code = RXAFS_SetVolumeStatus(tc->id, avc->fid.Fid.Volume,
                                        &storeStat, volName, offLineMsg, motd);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
           XSTATS_END_TIME;
        }
        else code = -1;
@@ -2244,13 +2228,9 @@ static PRemoveCallBack(avc, afun, areq, ain, aout, ainSize, aoutSize)
            tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
            if (tc) {
              XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS);
-#ifdef RX_ENABLE_LOCKS
-             AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+             RX_AFS_GUNLOCK();
              code = RXAFS_GiveUpCallBacks(tc->id, &theFids, &theCBs);
-#ifdef RX_ENABLE_LOCKS
-             AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+             RX_AFS_GLOCK();
              XSTATS_END_TIME;
            }
            /* don't set code on failure since we wouldn't use it */
@@ -3884,9 +3864,7 @@ static PPrefetchFromTape(avc, afun, areq, ain, aout, ainSize, aoutSize)
         tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
         if (tc) {
 
-#ifdef RX_ENABLE_LOCKS
-            AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+            RX_AFS_GUNLOCK();
             tcall = rx_NewCall(tc->id);
             code = StartRXAFS_FetchData(tcall,
                                 (struct AFSFid *) &tvc->fid.Fid, 0, 0);
@@ -3895,9 +3873,7 @@ static PPrefetchFromTape(avc, afun, areq, ain, aout, ainSize, aoutSize)
                 code = EndRXAFS_FetchData(tcall, &OutStatus, &CallBack, &tsync);
             }
             code1 = rx_EndCall(tcall, code);
-#ifdef RX_ENABLE_LOCKS
-            AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+            RX_AFS_GLOCK();
         } else
             code = -1;
     } while
@@ -3957,15 +3933,11 @@ afs_int32 *aoutSize;        /* set this */
         do {
             tc = afs_Conn(&tvc->fid, areq, SHARED_LOCK);
             if (tc) {
-#ifdef RX_ENABLE_LOCKS
-                AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                RX_AFS_GUNLOCK();
                 code = RXAFS_ResidencyCmd(tc->id, Fid,
                                  Inputs,
                                  (struct ResidencyCmdOutputs *) aout);
-#ifdef RX_ENABLE_LOCKS
-                AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                RX_AFS_GLOCK();
             } else
                 code = -1;
         } while
index a21793e..4c1f958 100644 (file)
@@ -74,14 +74,10 @@ int afs_StoreMini(avc, areq)
     do {
        tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
        if (tc) {
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
 retry:
            tcall = rx_NewCall(tc->id);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
            /* Set the client mod time since we always want the file
              * to have the client's mod time and not the server's one
              * (to avoid problems with make, etc.) It almost always
@@ -98,9 +94,7 @@ retry:
                ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(base), 
                ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(tlen), 
                ICL_TYPE_OFFSET, ICL_HANDLE_OFFSET(avc->m.Length));
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
 #ifdef AFS_64BIT_CLIENT
            if (!afs_serverHasNo64Bit(tc)) {
                code = StartRXAFS_StoreData64(tcall,
@@ -131,9 +125,7 @@ retry:
 #endif /* AFS_64BIT_CLIENT */
            }
            code = rx_EndCall(tcall, code);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
            XSTATS_END_TIME;
        }
        else code = -1;
@@ -381,9 +373,7 @@ afs_StoreAllSegments(avc, areq, sync)
                tc = afs_Conn(&avc->fid, areq);
                if (tc) {
 restart:
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GUNLOCK();
                    tcall = rx_NewCall(tc->id);
 #ifdef AFS_64BIT_CLIENT
                    if (!afs_serverHasNo64Bit(tc)) {
@@ -407,9 +397,7 @@ restart:
                    code = StartRXAFS_StoreData(tcall, (struct AFSFid *) &avc->fid.Fid,
                                                &InStatus, base, bytes, tlen);
 #endif /* AFS_64BIT_CLIENT */
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GLOCK();
                } else {
                    code = -1;
                    tcall = NULL;
@@ -520,13 +508,9 @@ restart:
                        while (sbytes > 0) {
                            tlen = (sbytes > AFS_LRALLOCSIZ ? AFS_LRALLOCSIZ : sbytes);
                            memset(tbuffer, 0, tlen);
-#ifdef RX_ENABLE_LOCKS
-                          AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                          RX_AFS_GUNLOCK();
                           bsent = rx_Write(tcall, tbuffer, tlen);
-#ifdef RX_ENABLE_LOCKS
-                          AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                          RX_AFS_GLOCK();
 
                            if (bsent != tlen) {
                                code = -33;     /* XXX */
@@ -548,13 +532,9 @@ restart:
                if (!code) {
                    struct AFSFetchStatus OutStatus;
                    struct AFSVolSync tsync;
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GUNLOCK();
                    code = EndRXAFS_StoreData(tcall, &OutStatus, &tsync);
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GLOCK();
                    hadd32(newDV, 1);
                    XSTATS_END_TIME;
       
@@ -572,13 +552,9 @@ restart:
                    ConvertWToSLock(&avc->lock);
                }
                if (tcall) {
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GUNLOCK();
                    code = rx_EndCall(tcall, code, avc, base);  
-#ifdef RX_ENABLE_LOCKS
-                   AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                   RX_AFS_GLOCK();
                }
            } while (afs_Analyze(tc, code, &avc->fid, areq,
                                 AFS_STATS_FS_RPCIDX_STOREDATA,
index 142fe8d..3acb5f6 100644 (file)
@@ -297,13 +297,9 @@ static void CheckVLServer(sa, areq)
        return;
     rx_SetConnDeadTime(tc->id, 3);
 
-#ifdef RX_ENABLE_LOCKS
-    AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GUNLOCK();
     code = VL_ProbeServer(tc->id);
-#ifdef RX_ENABLE_LOCKS
-    AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+    RX_AFS_GLOCK();
     rx_SetConnDeadTime(tc->id, 50);
     afs_PutConn(tc, SHARED_LOCK);
     /*
@@ -582,13 +578,9 @@ void afs_CheckServers(adown, acellp)
 
            XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GETTIME);
            start = osi_Time();         /* time the gettimeofday call */
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
            code = RXAFS_GetTime(tc->id, &tv.tv_sec, &tv.tv_usec);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
            end = osi_Time();
            XSTATS_END_TIME;
            /*
index 5730e37..415ec53 100644 (file)
@@ -378,14 +378,10 @@ afs_int32 afs_FlushVCBs (afs_int32 lockit)
                                            SHARED_LOCK);
                        if (tc) {
                          XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_GIVEUPCALLBACKS);
-#ifdef RX_ENABLE_LOCKS
-                         AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                         RX_AFS_GUNLOCK();
                          code = RXAFS_GiveUpCallBacks(tc->id, &fidArray,
                                                       &cbArray);
-#ifdef RX_ENABLE_LOCKS
-                         AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                         RX_AFS_GLOCK();
                          XSTATS_END_TIME;
                        }
                        else code = -1;
@@ -1052,16 +1048,12 @@ afs_FlushActiveVcaches(doflocks)
                    tc = afs_Conn(&tvc->fid, &treq, SHARED_LOCK);
                    if (tc) {
                      XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_EXTENDLOCK);
-#ifdef RX_ENABLE_LOCKS
-                     AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                     RX_AFS_GUNLOCK();
                      code =
                            RXAFS_ExtendLock(tc->id,
                                             (struct AFSFid *) &tvc->fid.Fid,
                                             &tsync);
-#ifdef RX_ENABLE_LOCKS
-                     AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                     RX_AFS_GLOCK();
                      XSTATS_END_TIME;
                    }
                    else code = -1;
@@ -1373,15 +1365,11 @@ afs_WriteVCache(avc, astatus, areq)
        tc = afs_Conn(&avc->fid, areq, SHARED_LOCK);
        if (tc) {
          XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_STORESTATUS);
-#ifdef RX_ENABLE_LOCKS
-         AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+         RX_AFS_GUNLOCK();
          code = RXAFS_StoreStatus(tc->id,
                                   (struct AFSFid *) &avc->fid.Fid,
                                   astatus, &OutStatus, &tsync);
-#ifdef RX_ENABLE_LOCKS
-         AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+         RX_AFS_GLOCK();
          XSTATS_END_TIME;
        }
        else code = -1;
@@ -1548,15 +1536,11 @@ afs_RemoteLookup(afid, areq, name, nfid, OutStatusp, CallBackp, serverp, tsyncp)
            if (serverp) *serverp = tc->srvr->server;
            start = osi_Time();
            XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_XLOOKUP);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
            code = RXAFS_Lookup(tc->id, (struct AFSFid *) &afid->Fid, name,
                                (struct AFSFid *) &nfid->Fid, 
                                OutStatusp, &OutDirStatus, CallBackp, tsyncp);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
            XSTATS_END_TIME;
        } else 
            code = -1;
@@ -2116,15 +2100,11 @@ afs_int32 afs_FetchStatus(struct vcache *avc, struct VenusFid *afid,
            avc->callback = tc->srvr->server;
            start = osi_Time();
            XSTATS_START_TIME(AFS_STATS_FS_RPCIDX_FETCHSTATUS);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GUNLOCK();
            code = RXAFS_FetchStatus(tc->id,
                                     (struct AFSFid *) &afid->Fid,
                                     Outsp, &CallBack, &tsync);
-#ifdef RX_ENABLE_LOCKS
-           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+           RX_AFS_GLOCK();
 
            XSTATS_END_TIME;
 
index 29609e1..2f268da 100644 (file)
@@ -619,51 +619,31 @@ static struct volume *afs_NewVolumeByName(char *aname, afs_int32 acell, int agoo
        if (tconn) {
            if (tconn->srvr->server->flags & SNO_LHOSTS) {
                type = 0;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                code = VL_GetEntryByNameO(tconn->id, aname, tve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
            } else if (tconn->srvr->server->flags & SYES_LHOSTS) {
                type = 1;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                code = VL_GetEntryByNameN(tconn->id, aname, ntve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
            } else {
                type = 2;
-#ifdef RX_ENABLE_LOCKS
-               AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GUNLOCK();
                code = VL_GetEntryByNameU(tconn->id, aname, utve);
-#ifdef RX_ENABLE_LOCKS
-               AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+               RX_AFS_GLOCK();
                if (!(tconn->srvr->server->flags & SVLSRV_UUID)) {
                    if (code == RXGEN_OPCODE) {
                        type = 1;
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GUNLOCK();
                         code = VL_GetEntryByNameN(tconn->id, aname, ntve);
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GLOCK();
                        if (code == RXGEN_OPCODE) {
                            type = 0;
                            tconn->srvr->server->flags |= SNO_LHOSTS;
-#ifdef RX_ENABLE_LOCKS
-                           AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                           RX_AFS_GUNLOCK();
                            code = VL_GetEntryByNameO(tconn->id, aname, tve);
-#ifdef RX_ENABLE_LOCKS
-                           AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                           RX_AFS_GLOCK();
                        } else if (!code)
                            tconn->srvr->server->flags |= SYES_LHOSTS;
                    } else if (!code)
@@ -968,13 +948,9 @@ void InstallUVolumeEntry(struct volume *av, struct uvldbentry *ve,
                    tconn = afs_ConnByMHosts(tcell->cellHosts, tcell->vlport,
                                             tcell->cell, areq, SHARED_LOCK);
                    if (tconn) {
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GUNLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GUNLOCK();
                        code = VL_GetAddrsU(tconn->id, &attrs, &uuid, &unique, &nentries, &addrs);
-#ifdef RX_ENABLE_LOCKS
-                       AFS_GLOCK();
-#endif /* RX_ENABLE_LOCKS */
+                       RX_AFS_GLOCK();
                    } else {
                        code = -1;
                    }