rx: Move server queue entry structure out of rx.h

Hide the server queue management structure in its own header file,
rather than exposing it globally in rx.h. This structure has always
been private - applications have no business knowing about it!

Change-Id: I97ac31e0e77dbe1c10b2804f33901d933a8f0627
Reviewed-on: http://gerrit.openafs.org/8231
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Simon Wilkinson 2012-10-11 12:34:46 +01:00 committed by Derrick Brashear
parent a7828d50a8
commit eca07c108c
6 changed files with 45 additions and 37 deletions

View File

@ -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

View File

@ -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 <afs/rxgen_consts.h>
@ -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 <stddef.h> /* for definition of offsetof() */
#endif

View File

@ -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 */

View File

@ -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

View File

@ -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

33
src/rx/rx_server.h Normal file
View File

@ -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;
};