diff --git a/src/rx/Makefile.in b/src/rx/Makefile.in index b5cfe3b525..d38e2e07b9 100644 --- a/src/rx/Makefile.in +++ b/src/rx/Makefile.in @@ -33,7 +33,7 @@ depinstall: includes rx_user.lo: rx.h rx_user.h rx_prototypes.h rx_packet.lo: rx_packet.c rx_packet.h rx.h rx_rdwr.lo: rx_rdwr.c rx.h rx_prototypes.h -rx.lo: rx.h rx_user.h rx_prototypes.h +rx.lo: rx.h rx_user.h rx_server.h rx_prototypes.h rx_conncache.lo: rx.h rx_prototypes.h rx_trace.lo: rx_trace.h rx_getaddr.lo: rx.h rx_getaddr.c rx_prototypes.h diff --git a/src/rx/rx.c b/src/rx/rx.c index 52de6be8ff..162ae4a2e4 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -86,6 +86,7 @@ extern afs_int32 afs_termState; #include "rx_conn.h" #include "rx_call.h" #include "rx_packet.h" +#include "rx_server.h" #include @@ -214,6 +215,14 @@ static afs_int32 rxi_busyChannelError = 0; rx_atomic_t rx_nWaiting = RX_ATOMIC_INIT(0); rx_atomic_t rx_nWaited = RX_ATOMIC_INIT(0); +/* Incoming calls wait on this queue when there are no available + * server processes */ +struct rx_queue rx_incomingCallQueue; + +/* Server processes wait on this queue when there are no appropriate + * calls to process */ +struct rx_queue rx_idleServerQueue; + #if !defined(offsetof) #include /* for definition of offsetof() */ #endif diff --git a/src/rx/rx.h b/src/rx/rx.h index 599935a7c4..35606bb2da 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -359,36 +359,6 @@ struct rx_service { #endif /* KDUMP_RX_LOCK */ -/* A server puts itself on an idle queue for a service using an - * instance of the following structure. When a call arrives, the call - * structure pointer is placed in "newcall", the routine to execute to - * service the request is placed in executeRequestProc, and the - * process is woken up. The queue entry's address is used for the - * sleep/wakeup. If socketp is non-null, then this thread is willing - * to become a listener thread. A thread sets *socketp to -1 before - * sleeping. If *socketp is not -1 when the thread awakes, it is now - * the listener thread for *socketp. When socketp is non-null, tno - * contains the server's threadID, which is used to make decitions in GetCall. - */ -#ifdef KDUMP_RX_LOCK -struct rx_serverQueueEntry_rx_lock { -#else -struct rx_serverQueueEntry { -#endif - struct rx_queue queueItemHeader; -#ifdef KDUMP_RX_LOCK - struct rx_call_rx_lock *newcall; -#else - struct rx_call *newcall; -#endif -#ifdef RX_ENABLE_LOCKS - afs_kmutex_t lock; - afs_kcondvar_t cv; -#endif - int tno; - osi_socket *socketp; -}; - #ifndef KDUMP_RX_LOCK /* Flag bits for connection structure */ #define RX_CONN_MAKECALL_WAITING 1 /* rx_NewCall is waiting for a channel */ diff --git a/src/rx/rx_globals.h b/src/rx/rx_globals.h index 16d6fce23a..dd86ba5259 100644 --- a/src/rx/rx_globals.h +++ b/src/rx/rx_globals.h @@ -44,12 +44,6 @@ EXT struct rx_service *rx_services[RX_MAX_SERVICES + 1]; EXT afs_kmutex_t rx_serverPool_lock; #endif /* RX_ENABLE_LOCKS */ -/* Incoming calls wait on this queue when there are no available server processes */ -EXT struct rx_queue rx_incomingCallQueue; - -/* Server processes wait on this queue when there are no appropriate calls to process */ -EXT struct rx_queue rx_idleServerQueue; - /* Constant delay time before sending a hard ack if the receiver consumes * a packet while no delayed ack event is scheduled. Ensures that the * sender is able to advance its window when the receiver consumes a packet diff --git a/src/rx/rx_packet.c b/src/rx/rx_packet.c index 89d9183d49..8fc0847be7 100644 --- a/src/rx/rx_packet.c +++ b/src/rx/rx_packet.c @@ -105,6 +105,8 @@ static int rxi_FreeDataBufsToQueue(struct rx_packet *p, afs_uint32 first, struct rx_queue * q); #endif +extern struct rx_queue rx_idleServerQueue; + /* some rules about packets: * 1. When a packet is allocated, the final iov_buf contains room for * a security trailer, but iov_len masks that fact. If the security diff --git a/src/rx/rx_server.h b/src/rx/rx_server.h new file mode 100644 index 0000000000..37b3e95053 --- /dev/null +++ b/src/rx/rx_server.h @@ -0,0 +1,33 @@ +/* Application server thread management structures and functions */ + +/* A server puts itself on an idle queue for a service using an + * instance of the following structure. When a call arrives, the call + * structure pointer is placed in "newcall", the routine to execute to + * service the request is placed in executeRequestProc, and the + * process is woken up. The queue entry's address is used for the + * sleep/wakeup. If socketp is non-null, then this thread is willing + * to become a listener thread. A thread sets *socketp to -1 before + * sleeping. If *socketp is not -1 when the thread awakes, it is now + * the listener thread for *socketp. When socketp is non-null, tno + * contains the server's threadID, which is used to make decisions + * in GetCall. + */ + +#ifdef KDUMP_RX_LOCK +struct rx_serverQueueEntry_rx_lock { +#else +struct rx_serverQueueEntry { +#endif + struct rx_queue queueItemHeader; +#ifdef KDUMP_RX_LOCK + struct rx_call_rx_lock *newcall; +#else + struct rx_call *newcall; +#endif +#ifdef RX_ENABLE_LOCKS + afs_kmutex_t lock; + afs_kcondvar_t cv; +#endif + int tno; + osi_socket *socketp; +};