From ae8b3d3f435f54fc1c712e771710a9aacb9bf692 Mon Sep 17 00:00:00 2001 From: Chas Williams Date: Thu, 14 Apr 2005 03:31:32 +0000 Subject: [PATCH] STABLE14-kill-rxglock-20050413 FIXES 18222 the rxglock was being defined out by all the platforms, just kill it. (cherry picked from commit dbeab01c12fd61305b9b5cc9a61036d934db1ce8) --- src/afs/AIX/osi_machdep.h | 4 ---- src/afs/DARWIN/osi_machdep.h | 3 --- src/afs/DUX/osi_machdep.h | 3 --- src/afs/FBSD/osi_machdep.h | 4 ---- src/afs/HPUX/osi_machdep.h | 4 ---- src/afs/IRIX/osi_machdep.h | 5 ----- src/afs/LINUX/osi_machdep.h | 4 ---- src/afs/NBSD/osi_machdep.h | 3 --- src/afs/OBSD/osi_machdep.h | 3 --- src/afs/SOLARIS/osi_machdep.h | 4 ---- src/afs/UKERNEL/afs_usrops.c | 20 -------------------- src/afs/afs_osi.h | 6 ------ src/afs/lock.h | 4 ---- src/rx/AIX/rx_kmutex.h | 11 ----------- src/rx/DUX/rx_knet.c | 2 -- src/rx/FBSD/rx_knet.c | 2 -- src/rx/HPUX/rx_kmutex.h | 4 ---- src/rx/OBSD/rx_kmutex.h | 3 --- src/rx/UKERNEL/rx_kmutex.h | 5 ----- src/rx/rx.c | 28 ---------------------------- src/rx/rx_event.c | 4 ---- src/rx/rx_kcommon.c | 4 ---- src/rx/rx_lwp.h | 2 -- src/rx/rx_packet.c | 8 -------- src/rx/rx_pthread.h | 10 ---------- src/rx/rx_rdwr.c | 16 ---------------- src/rx/rx_user.h | 4 ---- 27 files changed, 170 deletions(-) diff --git a/src/afs/AIX/osi_machdep.h b/src/afs/AIX/osi_machdep.h index e41bf7c609..acce91fee7 100644 --- a/src/afs/AIX/osi_machdep.h +++ b/src/afs/AIX/osi_machdep.h @@ -69,10 +69,6 @@ extern simple_lock_data afs_global_lock; simple_unlock((void *)&afs_global_lock); \ } while(0) #define ISAFS_GLOCK() lock_mine((void *)&afs_global_lock) - -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #endif #endif /* _OSI_MACHDEP_H_ */ diff --git a/src/afs/DARWIN/osi_machdep.h b/src/afs/DARWIN/osi_machdep.h index 8850718d50..409d64d85b 100644 --- a/src/afs/DARWIN/osi_machdep.h +++ b/src/afs/DARWIN/osi_machdep.h @@ -85,9 +85,6 @@ extern struct lock__bsd__ afs_global_lock; lockmgr(&afs_global_lock, LK_RELEASE, 0, current_proc()); \ } while(0) #define ISAFS_GLOCK() (afs_global_owner == current_thread()) -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #define SPLVAR #define NETPRI diff --git a/src/afs/DUX/osi_machdep.h b/src/afs/DUX/osi_machdep.h index 78b2630d06..b83f01f3de 100644 --- a/src/afs/DUX/osi_machdep.h +++ b/src/afs/DUX/osi_machdep.h @@ -63,9 +63,6 @@ extern thread_t afs_global_owner; usimple_unlock(&afs_global_lock); \ } while(0) #define ISAFS_GLOCK() (afs_global_owner == current_thread()) -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #undef SPLVAR #define SPLVAR diff --git a/src/afs/FBSD/osi_machdep.h b/src/afs/FBSD/osi_machdep.h index 83e7c83f43..79d490e4de 100644 --- a/src/afs/FBSD/osi_machdep.h +++ b/src/afs/FBSD/osi_machdep.h @@ -107,10 +107,6 @@ extern struct proc *afs_global_owner; #define ISAFS_GLOCK() (afs_global_owner == curproc && curproc) #endif /* FBSD50 */ -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 - #undef SPLVAR #define SPLVAR int splvar #undef NETPRI diff --git a/src/afs/HPUX/osi_machdep.h b/src/afs/HPUX/osi_machdep.h index b13f6e4611..d66f068ef0 100644 --- a/src/afs/HPUX/osi_machdep.h +++ b/src/afs/HPUX/osi_machdep.h @@ -80,10 +80,6 @@ extern void afsHashRelease(tid_t key); #endif -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 - /* Uses splnet only in the SP case */ #define SPLVAR register ulong_t splvar #define NETPRI NET_SPLNET(splvar) diff --git a/src/afs/IRIX/osi_machdep.h b/src/afs/IRIX/osi_machdep.h index c069b3617a..1397946d3a 100644 --- a/src/afs/IRIX/osi_machdep.h +++ b/src/afs/IRIX/osi_machdep.h @@ -172,11 +172,6 @@ extern long afs_global_owner; (AFS_ASSERT_GLOCK(), afs_global_owner = 0, mutex_exit(&afs_global_lock)) #define ISAFS_GLOCK() (osi_ThreadUnique() == afs_global_owner) #endif /* AFS_SGI64_ENV */ - -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 - #else /* MP */ #define AFS_GLOCK() #define AFS_GUNLOCK() diff --git a/src/afs/LINUX/osi_machdep.h b/src/afs/LINUX/osi_machdep.h index e3c8c1a167..142389e460 100644 --- a/src/afs/LINUX/osi_machdep.h +++ b/src/afs/LINUX/osi_machdep.h @@ -222,10 +222,6 @@ do { \ #define AFS_GUNLOCK() #define ISAFS_GLOCK() 1 #define AFS_ASSERT_GLOCK() -#define AFS_ASSERT_RXGLOCK() #endif -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #endif /* OSI_MACHDEP_H_ */ diff --git a/src/afs/NBSD/osi_machdep.h b/src/afs/NBSD/osi_machdep.h index b0c044266d..a1a3e3771b 100644 --- a/src/afs/NBSD/osi_machdep.h +++ b/src/afs/NBSD/osi_machdep.h @@ -76,9 +76,6 @@ extern thread_t afs_global_owner; simple_unlock(&afs_global_lock); \ } while(0) #endif /* 0 */ -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #undef SPLVAR #define SPLVAR diff --git a/src/afs/OBSD/osi_machdep.h b/src/afs/OBSD/osi_machdep.h index 4a45a756ba..be572072f6 100644 --- a/src/afs/OBSD/osi_machdep.h +++ b/src/afs/OBSD/osi_machdep.h @@ -139,9 +139,6 @@ extern struct simplelock afs_global_lock; #define AFS_ASSERT_GLOCK() #define ISAFS_GLOCK() 1 #endif -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #undef SPLVAR #define SPLVAR int splvar diff --git a/src/afs/SOLARIS/osi_machdep.h b/src/afs/SOLARIS/osi_machdep.h index 304d400226..e596578025 100644 --- a/src/afs/SOLARIS/osi_machdep.h +++ b/src/afs/SOLARIS/osi_machdep.h @@ -74,10 +74,6 @@ extern kmutex_t afs_rxglobal_lock; #define AFS_GLOCK() mutex_enter(&afs_global_lock); #define AFS_GUNLOCK() mutex_exit(&afs_global_lock); #define ISAFS_GLOCK() mutex_owned(&afs_global_lock) - -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 #endif diff --git a/src/afs/UKERNEL/afs_usrops.c b/src/afs/UKERNEL/afs_usrops.c index 665db24851..3445ea40e9 100644 --- a/src/afs/UKERNEL/afs_usrops.c +++ b/src/afs/UKERNEL/afs_usrops.c @@ -459,16 +459,12 @@ afs_osi_Sleep(void *x) { int index; osi_wait_t *waitp; - int rxGlockOwner = ISAFS_RXGLOCK(); int glockOwner = ISAFS_GLOCK(); usr_mutex_lock(&osi_waitq_lock); if (glockOwner) { AFS_GUNLOCK(); } - if (rxGlockOwner) { - AFS_RXGUNLOCK(); - } index = WAITHASH(x); if (osi_waithash_avail == NULL) { waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t)); @@ -495,9 +491,6 @@ afs_osi_Sleep(void *x) if (glockOwner) { AFS_GLOCK(); } - if (rxGlockOwner) { - AFS_RXGLOCK(); - } } int @@ -533,7 +526,6 @@ afs_osi_Wait(afs_int32 msec, struct afs_osi_WaitHandle *handle, int intok) osi_wait_t *waitp; struct timespec tv; int ret; - int rxGlockOwner = ISAFS_RXGLOCK(); int glockOwner = ISAFS_GLOCK(); tv.tv_sec = msec / 1000; @@ -542,25 +534,16 @@ afs_osi_Wait(afs_int32 msec, struct afs_osi_WaitHandle *handle, int intok) if (glockOwner) { AFS_GUNLOCK(); } - if (rxGlockOwner) { - AFS_RXGUNLOCK(); - } usr_thread_sleep(&tv); ret = 0; if (glockOwner) { AFS_GLOCK(); } - if (rxGlockOwner) { - AFS_RXGLOCK(); - } } else { usr_mutex_lock(&osi_waitq_lock); if (glockOwner) { AFS_GUNLOCK(); } - if (rxGlockOwner) { - AFS_RXGUNLOCK(); - } index = WAITHASH((caddr_t) handle); if (osi_waithash_avail == NULL) { waitp = (osi_wait_t *) afs_osi_Alloc(sizeof(osi_wait_t)); @@ -593,9 +576,6 @@ afs_osi_Wait(afs_int32 msec, struct afs_osi_WaitHandle *handle, int intok) if (glockOwner) { AFS_GLOCK(); } - if (rxGlockOwner) { - AFS_RXGLOCK(); - } } return ret; } diff --git a/src/afs/afs_osi.h b/src/afs/afs_osi.h index 62c14baaf3..ef81543a24 100644 --- a/src/afs/afs_osi.h +++ b/src/afs/afs_osi.h @@ -208,8 +208,6 @@ typedef struct timeval osi_timeval_t; #ifdef AFS_GLOBAL_SUNLOCK #define AFS_ASSERT_GLOCK() \ (ISAFS_GLOCK() || (osi_Panic("afs global lock not held at %s:%d\n", __FILE__, __LINE__), 0)) -#define AFS_ASSERT_RXGLOCK() \ - (ISAFS_RXGLOCK() || (osi_Panic("rx global lock not held at %s:%d\n", __FILE__, __LINE__), 0)) #endif /* AFS_GLOBAL_SUNLOCK */ #ifdef RX_ENABLE_LOCKS @@ -227,10 +225,6 @@ typedef struct timeval osi_timeval_t; #define AFS_GUNLOCK() #define ISAFS_GLOCK() 1 #define AFS_ASSERT_GLOCK() -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 -#define AFS_ASSERT_RXGLOCK() #endif /* On an MP that uses multithreading, splnet is not sufficient to provide diff --git a/src/afs/lock.h b/src/afs/lock.h index 4b449d7e18..a5d8253d7e 100644 --- a/src/afs/lock.h +++ b/src/afs/lock.h @@ -59,10 +59,6 @@ typedef struct afs_bozoLock afs_bozoLock_t; #undef MObtainWriteLock /* Defined also in ../rx/rx_machdep.h" */ #undef MReleaseWriteLock -#ifndef RXObtainWriteLock -#define RXObtainWriteLock(lock) ObtainWriteLock(lock) -#define RXReleaseWriteLock(lock) ReleaseWriteLock(lock) -#endif #define MObtainReadLock(lock) ObtainReadLock(lock) #define MObtainWriteLock(lock,src) ObtainWriteLock(lock,src) #define MObtainSharedLock(lock,src) ObtainSharedLock(lock,src) diff --git a/src/rx/AIX/rx_kmutex.h b/src/rx/AIX/rx_kmutex.h index e3862ac307..ed8f5513dc 100644 --- a/src/rx/AIX/rx_kmutex.h +++ b/src/rx/AIX/rx_kmutex.h @@ -68,15 +68,6 @@ typedef tid_t afs_kcondvar_t; __LINE__), \ simple_unlock((void *)(a)) - -#define RXObtainWriteLock(a) simple_lock((void *)(a)), \ - rxdb_grablock((void *)(a), thread_self(),rxdb_fileID,\ - __LINE__) - -#define RXReleaseWriteLock(a) rxdb_droplock((void *)(a), thread_self(), rxdb_fileID,\ - __LINE__), \ - simple_unlock((void *)(a)) - #define CV_WAIT(_cv, _lck) \ do { \ int haveGlock = ISAFS_GLOCK(); \ @@ -112,8 +103,6 @@ typedef tid_t afs_kcondvar_t; #define MUTEX_ENTER(a) simple_lock((void *)(a)) #define MUTEX_TRYENTER(a) simple_lock_try((void *)(a)) #define MUTEX_EXIT(a) simple_unlock((void *)(a)) -#define RXObtainWriteLock(a) simple_lock((void *)(a)) -#define RXReleaseWriteLock(a) simple_unlock((void *)(a)) #define CV_WAIT(_cv, _lck) \ do { \ diff --git a/src/rx/DUX/rx_knet.c b/src/rx/DUX/rx_knet.c index 281ec6fcd1..e9d2827665 100644 --- a/src/rx/DUX/rx_knet.c +++ b/src/rx/DUX/rx_knet.c @@ -144,7 +144,6 @@ rxk_input(struct mbuf *am, int iphlen) */ data_len = ntohs(tu->uh_ulen); data_len -= 8; - AFS_RXGLOCK(); if (!(*rxk_GetPacketProc) (&phandle, data_len)) { if (rx_mb_to_packet(am, m_freem, 28, data_len, phandle)) { /* XXX should just increment counter here.. */ @@ -155,7 +154,6 @@ rxk_input(struct mbuf *am, int iphlen) rxk_portRocks[i], data_len); } else m_freem(am); - AFS_RXGUNLOCK(); USERPRI; return; } diff --git a/src/rx/FBSD/rx_knet.c b/src/rx/FBSD/rx_knet.c index c9f73a8260..e70dcb4108 100644 --- a/src/rx/FBSD/rx_knet.c +++ b/src/rx/FBSD/rx_knet.c @@ -283,7 +283,6 @@ rxk_input(struct mbuf *am, int iphlen) */ data_len = ntohs(tu->uh_ulen); data_len -= 8; - AFS_RXGLOCK(); if (!(*rxk_GetPacketProc) (&phandle, data_len)) { if (rx_mb_to_packet(am, m_freem, 28, data_len, phandle)) { /* XXX should just increment counter here.. */ @@ -294,7 +293,6 @@ rxk_input(struct mbuf *am, int iphlen) rxk_portRocks[i], data_len); } else m_freem(am); - AFS_RXGUNLOCK(); USERPRI; return; } diff --git a/src/rx/HPUX/rx_kmutex.h b/src/rx/HPUX/rx_kmutex.h index 3a4f4c8481..09bd3bd8b9 100644 --- a/src/rx/HPUX/rx_kmutex.h +++ b/src/rx/HPUX/rx_kmutex.h @@ -132,10 +132,6 @@ typedef caddr_t afs_kcondvar_t; #ifdef AFS_HPUX102_ENV -#define RXObtainWriteLock(a) AFS_ASSERT_RXGLOCK() -#define RXReleaseWriteLock(a) - - #if defined(AFS_HPUX110_ENV) #undef osirx_AssertMine extern void osirx_AssertMine(afs_kmutex_t * lockaddr, char *msg); diff --git a/src/rx/OBSD/rx_kmutex.h b/src/rx/OBSD/rx_kmutex.h index d19b926114..dfe0c162e8 100644 --- a/src/rx/OBSD/rx_kmutex.h +++ b/src/rx/OBSD/rx_kmutex.h @@ -21,9 +21,6 @@ /* You can't have AFS_GLOBAL_SUNLOCK and not RX_ENABLE_LOCKS */ #define RX_ENABLE_LOCKS 1 #define AFS_GLOBAL_RXLOCK_KERNEL -#ifndef AFS_GLOBAL_SUNLOCK -#define AFS_ASSERT_RXGLOCK() -#endif /* This is incomplete and probably wouldn't work with NCPUS > 1 */ diff --git a/src/rx/UKERNEL/rx_kmutex.h b/src/rx/UKERNEL/rx_kmutex.h index 5b5c8850fe..38a140b0ac 100644 --- a/src/rx/UKERNEL/rx_kmutex.h +++ b/src/rx/UKERNEL/rx_kmutex.h @@ -49,11 +49,6 @@ extern void osirx_AssertMine(afs_kmutex_t * lockaddr, char *msg); #endif -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() -#define ISAFS_RXGLOCK() 1 -#define AFS_ASSERT_RXGLOCK() - #define SPLVAR #define NETPRI #define USERPRI diff --git a/src/rx/rx.c b/src/rx/rx.c index 31907fdfdb..9be2359fc5 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -468,7 +468,6 @@ rx_InitHost(u_int host, u_int port) rx_CheckPackets(); NETPRI; - AFS_RXGLOCK(); clock_Init(); @@ -534,7 +533,6 @@ rx_InitHost(u_int host, u_int port) * implementation environment--kernel or user space) */ rxi_StartListener(); - AFS_RXGUNLOCK(); USERPRI; tmp_status = rxinit_status = 0; UNLOCK_RX_INIT; @@ -667,7 +665,6 @@ rx_StartServer(int donateMe) clock_NewTime(); NETPRI; - AFS_RXGLOCK(); /* Start server processes, if necessary (exact function is dependent * on the implementation environment--kernel or user space). DonateMe * will be 1 if there is 1 pre-existing proc, i.e. this one. In this @@ -694,7 +691,6 @@ rx_StartServer(int donateMe) /* Turn on reaping of idle server connections */ rxi_ReapConnections(); - AFS_RXGUNLOCK(); USERPRI; if (donateMe) { @@ -746,7 +742,6 @@ rx_NewConnection(register afs_uint32 shost, u_short sport, u_short sservice, CV_INIT(&conn->conn_call_cv, "conn call cv", CV_DEFAULT, 0); #endif NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&rx_connHashTable_lock); cid = (rx_nextCid += RX_MAXCALLS); conn->type = RX_CLIENT_CONNECTION; @@ -780,7 +775,6 @@ rx_NewConnection(register afs_uint32 shost, u_short sport, u_short sservice, MUTEX_EXIT(&rx_stats_mutex); MUTEX_EXIT(&rx_connHashTable_lock); - AFS_RXGUNLOCK(); USERPRI; return conn; } @@ -1010,9 +1004,7 @@ rx_DestroyConnection(register struct rx_connection *conn) SPLVAR; NETPRI; - AFS_RXGLOCK(); rxi_DestroyConnection(conn); - AFS_RXGUNLOCK(); USERPRI; } @@ -1022,11 +1014,9 @@ rx_GetConnection(register struct rx_connection *conn) SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&conn->conn_data_lock); conn->refCount++; MUTEX_EXIT(&conn->conn_data_lock); - AFS_RXGUNLOCK(); USERPRI; } @@ -1052,7 +1042,6 @@ rx_NewCall(register struct rx_connection *conn) NETPRI; clock_GetTime(&queueTime); - AFS_RXGLOCK(); MUTEX_ENTER(&conn->conn_call_lock); /* @@ -1127,12 +1116,10 @@ rx_NewCall(register struct rx_connection *conn) MUTEX_EXIT(&call->lock); MUTEX_EXIT(&conn->conn_call_lock); - AFS_RXGUNLOCK(); USERPRI; #ifdef AFS_GLOBAL_RXLOCK_KERNEL /* Now, if TQ wasn't cleared earlier, do it now. */ - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); while (call->flags & RX_CALL_TQ_BUSY) { call->flags |= RX_CALL_TQ_WAIT; @@ -1147,7 +1134,6 @@ rx_NewCall(register struct rx_connection *conn) queue_Init(&call->tq); } MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); #endif /* AFS_GLOBAL_RXLOCK_KERNEL */ return call; @@ -1250,7 +1236,6 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName, tservice = rxi_AllocService(); NETPRI; - AFS_RXGLOCK(); for (i = 0; i < RX_MAX_SERVICES; i++) { register struct rx_service *service = rx_services[i]; if (service) { @@ -1263,7 +1248,6 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName, (osi_Msg "rx_NewService: tried to install service %s with service id %d, which is already in use for service %s\n", serviceName, serviceId, service->serviceName); - AFS_RXGUNLOCK(); USERPRI; rxi_FreeService(tservice); return service; @@ -1278,7 +1262,6 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName, * service on same port) get a new one */ socket = rxi_GetHostUDPSocket(htonl(INADDR_ANY), port); if (socket == OSI_NULLSOCKET) { - AFS_RXGUNLOCK(); USERPRI; rxi_FreeService(tservice); return 0; @@ -1298,12 +1281,10 @@ rx_NewService(u_short port, u_short serviceId, char *serviceName, service->executeRequestProc = serviceProc; service->checkReach = 0; rx_services[i] = service; /* not visible until now */ - AFS_RXGUNLOCK(); USERPRI; return service; } } - AFS_RXGUNLOCK(); USERPRI; rxi_FreeService(tservice); (osi_Msg "rx_NewService: cannot support > %d services\n", @@ -1343,14 +1324,12 @@ rxi_ServerProc(int threadID, struct rx_call *newcall, osi_socket * socketp) SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); rxi_CallError(call, RX_RESTARTING); rxi_SendCallAbort(call, (struct rx_packet *)0, 0, 0); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; } #ifdef KERNEL @@ -1392,7 +1371,6 @@ rx_WakeupServerProcs(void) SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&rx_serverPool_lock); #ifdef RX_ENABLE_LOCKS @@ -1420,7 +1398,6 @@ rx_WakeupServerProcs(void) #endif /* RX_ENABLE_LOCKS */ } MUTEX_EXIT(&rx_serverPool_lock); - AFS_RXGUNLOCK(); USERPRI; } @@ -1631,7 +1608,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&freeSQEList_lock); if ((sq = rx_FreeSQEList)) { @@ -1726,7 +1702,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) osi_rxSleep(sq); #ifdef KERNEL if (afs_termState == AFSOP_STOP_RXCALLBACK) { - AFS_RXGUNLOCK(); USERPRI; rxi_Free(sq, sizeof(struct rx_serverQueueEntry)); return (struct rx_call *)0; @@ -1767,7 +1742,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) dpf(("rx_GetCall(socketp=0x%x, *socketp=0x%x)\n", socketp, *socketp)); } - AFS_RXGUNLOCK(); USERPRI; return call; @@ -1815,7 +1789,6 @@ rx_EndCall(register struct rx_call *call, afs_int32 rc) dpf(("rx_EndCall(call %x)\n", call)); NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); if (rc == 0 && call->error == 0) { @@ -1926,7 +1899,6 @@ rx_EndCall(register struct rx_call *call, afs_int32 rc) MUTEX_EXIT(&conn->conn_call_lock); conn->flags &= ~RX_CONN_BUSY; } - AFS_RXGUNLOCK(); USERPRI; /* * Map errors to the local host's errno.h format. diff --git a/src/rx/rx_event.c b/src/rx/rx_event.c index ca1365a022..402c378820 100644 --- a/src/rx/rx_event.c +++ b/src/rx/rx_event.c @@ -198,7 +198,6 @@ _rxevent_Post(struct clock *when, void (*func) (), void *arg, void *arg1, int isEarliest = 0; MUTEX_ENTER(&rxevent_lock); - AFS_ASSERT_RXGLOCK(); #ifdef RXDEBUG if (rx_Log_event) { struct clock now; @@ -337,7 +336,6 @@ rxevent_Cancel_1(register struct rxevent *ev, register struct rx_call *call, /* Append it to the free list (rather than prepending) to keep the free * list hot so nothing pages out */ - AFS_ASSERT_RXGLOCK(); MUTEX_ENTER(&rxevent_lock); if (!ev) { MUTEX_EXIT(&rxevent_lock); @@ -383,8 +381,6 @@ rxevent_RaiseEvents(struct clock *next) MUTEX_ENTER(&rxevent_lock); - AFS_ASSERT_RXGLOCK(); - /* Events are sorted by time, so only scan until an event is found that has * not yet timed out */ diff --git a/src/rx/rx_kcommon.c b/src/rx/rx_kcommon.c index f0b2e8e983..4687409226 100644 --- a/src/rx/rx_kcommon.c +++ b/src/rx/rx_kcommon.c @@ -964,9 +964,7 @@ afs_rxevent_daemon(void) AFS_GUNLOCK(); #endif /* RX_ENABLE_LOCKS */ NETPRI; - AFS_RXGLOCK(); rxevent_RaiseEvents(&temp); - AFS_RXGUNLOCK(); USERPRI; #ifdef RX_ENABLE_LOCKS AFS_GLOCK(); @@ -1151,9 +1149,7 @@ rxk_Listener(void) osi_Panic("rxk_Listener: No more Rx buffers!\n"); } if (!(code = rxk_ReadPacket(rx_socket, rxp, &host, &port))) { - AFS_RXGLOCK(); rxp = rxi_ReceivePacket(rxp, rx_socket, host, port, 0, 0); - AFS_RXGUNLOCK(); } } diff --git a/src/rx/rx_lwp.h b/src/rx/rx_lwp.h index aea7945768..720196dd3b 100644 --- a/src/rx/rx_lwp.h +++ b/src/rx/rx_lwp.h @@ -19,8 +19,6 @@ #define CALL_HOLD(call, type) #define CALL_RELE(call, type) -#define RXObtainWriteLock(a) AFS_ASSERT_RXGLOCK() -#define RXReleaseWriteLock(a) #define MUTEX_DESTROY(a) #define MUTEX_ENTER(a) diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index c4247ae98e..40b5a98cd0 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -393,7 +393,6 @@ rxi_MorePackets(int apackets) PIN(p, getme); /* XXXXX */ memset((char *)p, 0, getme); NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&rx_freePktQ_lock); for (e = p + apackets; p < e; p++) { @@ -410,7 +409,6 @@ rxi_MorePackets(int apackets) rxi_NeedMorePackets = FALSE; rxi_PacketsUnWait(); - AFS_RXGUNLOCK(); MUTEX_EXIT(&rx_freePktQ_lock); USERPRI; } @@ -1487,7 +1485,6 @@ rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket, } else nbytes -= apacket->wirevec[i].iov_len; } - AFS_RXGUNLOCK(); #ifdef KERNEL #ifdef RX_KERNEL_TRACE if (ICL_SETACTIVE(afs_iclSetp)) { @@ -1519,7 +1516,6 @@ rxi_SendDebugPacket(struct rx_packet *apacket, osi_socket asocket, AFS_GLOCK(); #endif #endif - AFS_RXGLOCK(); if (saven) { /* means we truncated the packet above. */ apacket->wirevec[i - 1].iov_len = savelen; apacket->niovecs = saven; @@ -1605,7 +1601,6 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn, * blocking socket, but unfortunately the interface doesn't * allow us to have the socket block in send mode, and not * block in receive mode */ - AFS_RXGUNLOCK(); #ifdef KERNEL waslocked = ISAFS_GLOCK(); #ifdef RX_KERNEL_TRACE @@ -1656,7 +1651,6 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn, AFS_GLOCK(); #endif #endif - AFS_RXGLOCK(); #ifdef RXDEBUG } dpf(("%c %d %s: %x.%u.%u.%u.%u.%u.%u flags %d, packet %lx resend %d.%0.3d len %d", deliveryType, p->header.serial, rx_packetTypes[p->header.type - 1], peer->host, peer->port, p->header.serial, p->header.epoch, p->header.cid, p->header.callNumber, p->header.seq, p->header.flags, (unsigned long)p, p->retryTime.sec, p->retryTime.usec / 1000, p->length)); @@ -1799,7 +1793,6 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn, * blocking socket, but unfortunately the interface doesn't * allow us to have the socket block in send mode, and not * block in receive mode */ - AFS_RXGUNLOCK(); #if defined(AFS_SUN5_ENV) && defined(KERNEL) waslocked = ISAFS_GLOCK(); if (!istack && waslocked) @@ -1832,7 +1825,6 @@ rxi_SendPacketList(struct rx_call *call, struct rx_connection *conn, if (!istack && waslocked) AFS_GLOCK(); #endif - AFS_RXGLOCK(); #ifdef RXDEBUG } diff --git a/src/rx/rx_pthread.h b/src/rx/rx_pthread.h index d7e59b5a84..6ae4af7684 100644 --- a/src/rx/rx_pthread.h +++ b/src/rx/rx_pthread.h @@ -94,16 +94,6 @@ extern void osirx_AssertMine(afs_kmutex_t * lockaddr, char *msg); #endif #define MUTEX_EXIT(l) osi_Assert(pthread_mutex_unlock(l) == 0) -#ifdef RXObtainWriteLock -#undef RXObtainWriteLock -#endif -#define RXObtainWriteLock(l) MUTEX_ENTER(l) - -#ifdef RXReleaseWriteLock -#undef RXReleaseWriteLock -#endif -#define RXReleaseWriteLock(l) MUTEX_EXIT(l) - #ifdef CV_INIT #undef CV_INIT #endif diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index c4a835fa18..82dc947f54 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -337,11 +337,9 @@ rx_ReadProc(struct rx_call *call, char *buf, int nbytes) } NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_ReadProc(call, buf, nbytes); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -396,11 +394,9 @@ rx_ReadProc32(struct rx_call *call, afs_int32 * value) } NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_ReadProc(call, (char *)value, sizeof(afs_int32)); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -644,11 +640,9 @@ rx_ReadvProc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_ReadvProc(call, iov, nio, maxio, nbytes); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -867,11 +861,9 @@ rx_WriteProc(struct rx_call *call, char *buf, int nbytes) } NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_WriteProc(call, buf, nbytes); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -926,11 +918,9 @@ rx_WriteProc32(register struct rx_call *call, register afs_int32 * value) } NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_WriteProc(call, (char *)value, sizeof(afs_int32)); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -1059,11 +1049,9 @@ rx_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_WritevAlloc(call, iov, nio, maxio, nbytes); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -1230,11 +1218,9 @@ rx_WritevProc(struct rx_call *call, struct iovec *iov, int nio, int nbytes) SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); bytes = rxi_WritevProc(call, iov, nio, nbytes); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; return bytes; } @@ -1324,10 +1310,8 @@ rx_FlushWrite(struct rx_call *call) { SPLVAR; NETPRI; - AFS_RXGLOCK(); MUTEX_ENTER(&call->lock); rxi_FlushWrite(call); MUTEX_EXIT(&call->lock); - AFS_RXGUNLOCK(); USERPRI; } diff --git a/src/rx/rx_user.h b/src/rx/rx_user.h index 3810be4035..35bec90c4c 100644 --- a/src/rx/rx_user.h +++ b/src/rx/rx_user.h @@ -24,14 +24,10 @@ error - foo error - foo error - foo #define AFS_GLOCK() #define AFS_GUNLOCK() #define AFS_ASSERT_GLOCK() -#define AFS_RXGLOCK() -#define AFS_RXGUNLOCK() #ifndef UKERNEL /* Defined in rx/UKERNEL/rx_kmutex.h */ #define ISAFS_GLOCK() -#define ISAFS_RXGLOCK() #endif -#define AFS_ASSERT_RXGLOCK() /* Some "operating-system independent" stuff, for the user mode implementation */ #ifdef UAFS_CLIENT typedef void *osi_socket;