From cb25e4400aa97379ec1b4390ddb3d343dc070935 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Tue, 20 Jun 2006 21:07:06 +0000 Subject: [PATCH] revert-rx-magic-check-20060607 revert until i recode to avoid conflict with queues --- src/rx/rx.c | 39 +-------------------------------------- src/rx/rx.h | 7 ------- src/rx/rx_null.c | 4 +--- src/rxkad/rxkad_client.c | 3 --- src/rxkad/rxkad_server.c | 2 -- src/util/Makefile.in | 5 ----- 6 files changed, 2 insertions(+), 58 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 5cc759465..e58b1d8d5 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -77,7 +77,6 @@ extern afs_int32 afs_termState; #include "sys/lock_def.h" #endif /* AFS_AIX41_ENV */ # include "rxgen_consts.h" -# include "afs/magic.h" #else /* KERNEL */ # include # include @@ -108,7 +107,6 @@ extern afs_int32 afs_termState; # include "rx_globals.h" # include "rx_trace.h" # include -# include #endif /* KERNEL */ int (*registerProgram) () = 0; @@ -836,7 +834,6 @@ rx_NewConnectionAddrs(struct sockaddr_storage *saddr, int *type, int *slen, SPLVAR; - osi_Assert(securityObject->magic == MAGIC_RXSECURITY); clock_NewTime(); dpf(("rx_NewConnection(host %x, port %u, service %u, securityObject %x, serviceSecurityIndex %d)\n", ntohl(rx_ss2v4addr(saddr)), ntohs(rx_ss2pn(saddr)), sservice, securityObject, serviceSecurityIndex)); @@ -851,7 +848,6 @@ rx_NewConnectionAddrs(struct sockaddr_storage *saddr, int *type, int *slen, NETPRI; MUTEX_ENTER(&rx_connHashTable_lock); cid = (rx_nextCid += RX_MAXCALLS); - conn->magic = MAGIC_RXCONN; conn->type = RX_CLIENT_CONNECTION; conn->cid = cid; conn->epoch = rx_epoch; @@ -915,15 +911,11 @@ int rxi_lowConnRefCount = 0; void rxi_CleanupConnection(struct rx_connection *conn) { - osi_Assert(conn->magic == MAGIC_RXCONN); - /* Notify the service exporter, if requested, that this connection * is being destroyed */ if (conn->type == RX_SERVER_CONNECTION && conn->service->destroyConnProc) (*conn->service->destroyConnProc) (conn); - conn->magic = MAGIC_RXCONN_FREE; - /* Notify the security module that this connection is being destroyed */ RXS_DestroyConnection(conn->securityObject, conn); @@ -976,8 +968,6 @@ rxi_CleanupConnection(struct rx_connection *conn) void rxi_DestroyConnection(register struct rx_connection *conn) { - osi_Assert(conn->magic == MAGIC_RXCONN); - MUTEX_ENTER(&rx_connHashTable_lock); rxi_DestroyConnectionNoLock(conn); /* conn should be at the head of the cleanup list */ @@ -1136,7 +1126,6 @@ rx_GetConnection(register struct rx_connection *conn) { SPLVAR; - osi_Assert(conn->magic == MAGIC_RXCONN); NETPRI; MUTEX_ENTER(&conn->conn_data_lock); conn->refCount++; @@ -1161,7 +1150,6 @@ rx_NewCall(register struct rx_connection *conn) struct clock queueTime; SPLVAR; - osi_Assert(conn->magic == MAGIC_RXCONN); clock_NewTime(); dpf(("rx_MakeCall(conn %x)\n", conn)); @@ -1434,7 +1422,6 @@ rx_NewServiceHost(afs_uint32 host, u_short port, u_short serviceId, } } service = tservice; - service->magic = MAGIC_RXSVC; service->socket = socket; service->serviceHost = host; service->servicePort = port; @@ -1616,8 +1603,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) struct rx_service *service = NULL; SPLVAR; - osi_Assert(cur_service->magic == MAGIC_RXSVC); - MUTEX_ENTER(&freeSQEList_lock); if ((sq = rx_FreeSQEList)) { @@ -1785,8 +1770,6 @@ rx_GetCall(int tno, struct rx_service *cur_service, osi_socket * socketp) struct rx_service *service = NULL; SPLVAR; - osi_Assert(cur_service->magic == MAGIC_RXSVC); - NETPRI; MUTEX_ENTER(&freeSQEList_lock); @@ -1963,7 +1946,6 @@ rx_EndCall(register struct rx_call *call, afs_int32 rc) register struct rx_service *service; afs_int32 error; SPLVAR; - osi_Assert(call->magic == MAGIC_RXCALL); @@ -2198,8 +2180,6 @@ rxi_NewCall(register struct rx_connection *conn, register int channel) register struct rx_call *nxp; /* Next call pointer, for queue_Scan */ #endif /* AFS_GLOBAL_RXLOCK_KERNEL */ - osi_Assert(conn->magic == MAGIC_RXCONN); - /* Grab an existing call structure, or allocate a new one. * Existing call structures are assumed to have been left reset by * rxi_FreeCall */ @@ -2271,8 +2251,6 @@ rxi_NewCall(register struct rx_connection *conn, register int channel) if (*call->callNumber == 0) *call->callNumber = 1; - call->magic = MAGIC_RXCALL; - return call; } @@ -2294,15 +2272,11 @@ rxi_FreeCall(register struct rx_call *call) register struct rx_connection *conn = call->conn; - osi_Assert(call->magic == MAGIC_RXCALL); - if (call->state == RX_STATE_DALLY || call->state == RX_STATE_HOLD) (*call->callNumber)++; rxi_ResetCall(call, 0); call->conn->call[channel] = (struct rx_call *)0; - call->magic = MAGIC_RXCALL_FREE; - MUTEX_ENTER(&rx_freeCallQueue_lock); SET_CALL_QUEUE_LOCK(call, &rx_freeCallQueue_lock); #ifdef AFS_GLOBAL_RXLOCK_KERNEL @@ -2403,7 +2377,6 @@ rxi_FindPeer(struct sockaddr_storage *saddr, int slen, int stype, if (!pp) { if (create) { pp = rxi_AllocPeer(); /* This bzero's *pp */ - pp->magic = MAGIC_RXPEER; memcpy(&pp->saddr, saddr, slen); pp->saddrlen = slen; pp->socktype = stype; @@ -2458,10 +2431,8 @@ rxi_FindPeer(struct sockaddr_storage *saddr, int slen, int stype, if (pp && create) { pp->refCount++; } - if (origPeer) { - osi_Assert(origPeer->magic == MAGIC_RXPEER); + if (origPeer) origPeer->refCount--; - } MUTEX_EXIT(&rx_peerHashTable_lock); return pp; } @@ -2540,7 +2511,6 @@ rxi_FindConnection(osi_socket socket, struct sockaddr_storage *saddr, CV_INIT(&conn->conn_call_cv, "conn call cv", CV_DEFAULT, 0); conn->next = rx_connHashTable[hashindex]; rx_connHashTable[hashindex] = conn; - conn->magic = MAGIC_RXCONN; conn->peer = rxi_FindPeer(saddr, slen, socktype, 0, 1); conn->type = RX_SERVER_CONNECTION; conn->lastSendTime = clock_Sec(); /* don't GC immediately */ @@ -6056,7 +6026,6 @@ rxi_ReapConnections(void) peer_ptr++) { struct rx_peer *peer, *next, *prev; for (prev = peer = *peer_ptr; peer; peer = next) { - osi_Assert(peer->magic == MAGIC_RXPEER); next = peer->next; code = MUTEX_TRYENTER(&peer->peer_lock); if ((code) && (peer->refCount == 0) @@ -6136,8 +6105,6 @@ rxi_ReapConnections(void) int rxs_Release(struct rx_securityClass *aobj) { - osi_Assert(aobj->magic == MAGIC_RXSECURITY); - return RXS_Close(aobj); } @@ -6985,9 +6952,7 @@ void rx_SetSpecific(struct rx_connection *conn, int key, void *ptr) { int i; - osi_Assert(conn->magic == MAGIC_RXCONN); MUTEX_ENTER(&conn->conn_data_lock); - osi_Assert(conn->magic == MAGIC_RXCONN); if (!conn->specific) { conn->specific = (void **)malloc((key + 1) * sizeof(void *)); for (i = 0; i < key; i++) @@ -7013,9 +6978,7 @@ void * rx_GetSpecific(struct rx_connection *conn, int key) { void *ptr; - osi_Assert(conn->magic == MAGIC_RXCONN); MUTEX_ENTER(&conn->conn_data_lock); - osi_Assert(conn->magic == MAGIC_RXCONN); if (key >= conn->nSpecific) ptr = NULL; else diff --git a/src/rx/rx.h b/src/rx/rx.h index 574d0ae99..f17a87d96 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -229,12 +229,10 @@ returned with an error code of RX_CALL_DEAD ( transient error ) */ limited multiple asynchronous conversations. */ #ifdef KDUMP_RX_LOCK struct rx_connection_rx_lock { - int magic; struct rx_connection_rx_lock *next; /* on hash chain _or_ free list */ struct rx_peer_rx_lock *peer; #else struct rx_connection { - int magic; struct rx_connection *next; /* on hash chain _or_ free list */ struct rx_peer *peer; #endif @@ -308,7 +306,6 @@ struct rx_connection { * requests. */ struct rx_service { - int magic; u_short serviceId; /* Service number */ afs_uint32 serviceHost; /* IP address for this service */ u_short servicePort; /* UDP port for this service */ @@ -369,11 +366,9 @@ struct rx_serverQueueEntry { /* A peer refers to a peer process, specified by a (host,port) pair. There may be more than one peer on a given host. */ #ifdef KDUMP_RX_LOCK struct rx_peer_rx_lock { - int magic; struct rx_peer_rx_lock *next; /* Next in hash conflict or free list */ #else struct rx_peer { - int magic; struct rx_peer *next; /* Next in hash conflict or free list */ #endif #ifdef RX_ENABLE_LOCKS @@ -459,7 +454,6 @@ struct rx_call_rx_lock { #else struct rx_call { #endif - int magic; struct rx_queue queue_item_header; /* Call can be on various queues (one-at-a-time) */ struct rx_queue tq; /* Transmit packet queue */ struct rx_queue rq; /* Receive packet queue */ @@ -726,7 +720,6 @@ struct rx_securityObjectStats { * provide routines to create these objects. Rx provides a basic routine to * allocate one of these objects; this routine must be called by the class. */ struct rx_securityClass { - int magic; struct rx_securityOps { int (*op_Close) (struct rx_securityClass * aobj); int (*op_NewConnection) (struct rx_securityClass * aobj, diff --git a/src/rx/rx_null.c b/src/rx/rx_null.c index 7f888580b..d8ff2c119 100644 --- a/src/rx/rx_null.c +++ b/src/rx/rx_null.c @@ -24,16 +24,14 @@ RCSID #include "afs/sysincludes.h" #endif /* !UKERNEL */ #include "rx/rx.h" -#include "afs/magic.h" #else /* KERNEL */ #include "rx.h" -#include #endif /* KERNEL */ /* The null security object. No authentication, no nothing. */ static struct rx_securityOps null_ops; -static struct rx_securityClass null_object = { MAGIC_RXSECURITY, &null_ops, 0, 0 }; +static struct rx_securityClass null_object = { &null_ops, 0, 0 }; struct rx_securityClass * rxnull_NewServerSecurityObject(void) diff --git a/src/rxkad/rxkad_client.c b/src/rxkad/rxkad_client.c index 547db7295..1f83e2c17 100644 --- a/src/rxkad/rxkad_client.c +++ b/src/rxkad/rxkad_client.c @@ -43,7 +43,6 @@ RCSID #include "rx/xdr.h" #endif #include "rx/rx.h" -#include "afs/magic.h" #else /* ! KERNEL */ #include #include @@ -65,7 +64,6 @@ RCSID #ifdef AFS_PTHREAD_ENV #include "rx/rxkad.h" #endif /* AFS_PTHREAD_ENV */ -#include #endif /* KERNEL */ #include @@ -188,7 +186,6 @@ rxkad_NewClientSecurityObject(rxkad_level level, size = sizeof(struct rx_securityClass); tsc = (struct rx_securityClass *)rxi_Alloc(size); memset((void *)tsc, 0, size); - tsc->magic = MAGIC_RXSECURITY; tsc->refCount = 1; /* caller gets one for free */ tsc->ops = &rxkad_client_ops; diff --git a/src/rxkad/rxkad_server.c b/src/rxkad/rxkad_server.c index f47c4f628..92097da21 100644 --- a/src/rxkad/rxkad_server.c +++ b/src/rxkad/rxkad_server.c @@ -38,7 +38,6 @@ RCSID #include #include #include -#include #include #include #include "private_data.h" @@ -151,7 +150,6 @@ rxkad_NewServerSecurityObject(rxkad_level level, char *get_key_rock, size = sizeof(struct rx_securityClass); tsc = (struct rx_securityClass *)osi_Alloc(size); memset(tsc, 0, size); - tsc->magic = MAGIC_RXSECURITY; tsc->refCount = 1; /* caller has one reference */ tsc->ops = &rxkad_server_ops; size = sizeof(struct rxkad_sprivate); diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 12341afc1..ccf344669 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -33,7 +33,6 @@ includes = \ ${TOP_INCDIR}/afs/afs_atomlist.h \ ${TOP_INCDIR}/afs/afs_lhash.h \ ${TOP_INCDIR}/afs/softsig.h \ - ${TOP_INCDIR}/afs/magic.h \ ${TOP_INCDIR}/potpourri.h all: ${includes} \ @@ -167,7 +166,6 @@ install: \ ${DESTDIR}${includedir}/afs/afs_atomlist.h \ ${DESTDIR}${includedir}/afs/afs_lhash.h \ ${DESTDIR}${includedir}/afs/softsig.h \ - ${DESTDIR}${includedir}/afs/magic.h \ ${DESTDIR}${includedir}/potpourri.h \ ${DESTDIR}${libdir}/afs/util.a \ ${DESTDIR}${libdir}/afs/libafsutil.a \ @@ -221,9 +219,6 @@ ${TOP_INCDIR}/afs/afs_lhash.h: ${srcdir}/afs_lhash.h ${TOP_INCDIR}/afs/softsig.h: ${srcdir}/softsig.h ${INSTALL} $? $@ -${TOP_INCDIR}/afs/magic.h: ${srcdir}/magic.h - ${INSTALL} $? $@ - ${TOP_INCDIR}/potpourri.h: ${srcdir}/potpourri.h ${INSTALL} $? $@ -- 2.39.5