From 51f079e178b22595a990ed64cbe9a5b00e212421 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 27 Sep 2010 11:51:20 +0100 Subject: [PATCH] rx: Make private things private Make rxi_* functions that are only used within the file that they're defined in actually be private, rather than sharing them with the world. Change-Id: I67b9a36e8ce3fa0d3258842a8d7a5fed31c787ce Reviewed-on: http://gerrit.openafs.org/4804 Tested-by: BuildBot Tested-by: Jeffrey Altman Reviewed-by: Jeffrey Altman --- src/rx/rx.c | 17 ++++++++++------- src/rx/rx_prototypes.h | 15 --------------- src/rx/rx_rdwr.c | 2 +- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 900312e..06fdef2 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -150,6 +150,9 @@ rx_atomic_t rx_nWaited = RX_ATOMIC_INIT(0); afs_kmutex_t rx_atomic_mutex; #endif +/* Forward prototypes */ +static struct rx_call * rxi_NewCall(struct rx_connection *, int); + #ifdef AFS_PTHREAD_ENV /* @@ -298,7 +301,7 @@ pthread_once_t rx_once_init = PTHREAD_ONCE_INIT; #if defined(RX_ENABLE_LOCKS) && defined(KERNEL) static afs_kmutex_t rx_rpc_stats; -void rxi_StartUnlocked(struct rxevent *event, void *call, +static void rxi_StartUnlocked(struct rxevent *event, void *call, void *arg1, int istack); #endif @@ -687,7 +690,7 @@ QuotaOK(struct rx_service *aservice) /* Called by rx_StartServer to start up lwp's to service calls. NExistingProcs gives the number of procs already existing, and which therefore needn't be created. */ -void +static void rxi_StartServerProcs(int nExistingProcs) { struct rx_service *service; @@ -934,7 +937,7 @@ int rxi_lowConnRefCount = 0; * Cleanup a connection that was destroyed in rxi_DestroyConnectioNoLock. * NOTE: must not be called with rx_connHashTable_lock held. */ -void +static void rxi_CleanupConnection(struct rx_connection *conn) { /* Notify the service exporter, if requested, that this connection @@ -1448,7 +1451,7 @@ rx_NewCall(struct rx_connection *conn) return call; } -int +static int rxi_HasActiveCalls(struct rx_connection *aconn) { int i; @@ -2369,7 +2372,7 @@ rxi_PacketsUnWait(void) /* Return this process's service structure for the * specified socket and service */ -struct rx_service * +static struct rx_service * rxi_FindService(osi_socket socket, u_short serviceId) { struct rx_service **sp; @@ -2391,7 +2394,7 @@ static struct rx_call *rx_allCallsp = 0; /* Allocate a call structure, for the indicated channel of the * supplied connection. The mode and state of the call must be set by * the caller. Returns the call with mutex locked. */ -struct rx_call * +static struct rx_call * rxi_NewCall(struct rx_connection *conn, int channel) { struct rx_call *call; @@ -2494,7 +2497,7 @@ rxi_NewCall(struct rx_connection *conn, int channel) * call->lock amd rx_refcnt_mutex are held upon entry. * haveCTLock is set when called from rxi_ReapConnections. */ -void +static void rxi_FreeCall(struct rx_call *call, int haveCTLock) { int channel = call->channel; diff --git a/src/rx/rx_prototypes.h b/src/rx/rx_prototypes.h index 6e39b0b..eabc87d 100644 --- a/src/rx/rx_prototypes.h +++ b/src/rx/rx_prototypes.h @@ -30,9 +30,6 @@ extern void rx_DebugOnOff(int on); extern void rx_StatsOnOff(int on); extern void rx_StartClientThread(void); #endif -#ifndef KERNEL -extern void rxi_StartServerProcs(int nExistingProcs); -#endif extern void rx_StartServer(int donateMe); extern struct rx_connection *rx_NewConnection(afs_uint32 shost, u_short sport, u_short sservice, @@ -43,12 +40,10 @@ extern void rx_SetConnDeadTime(struct rx_connection *conn, int seconds); extern void rx_SetConnHardDeadTime(struct rx_connection *conn, int seconds); extern void rx_SetConnIdleDeadTime(struct rx_connection *conn, int seconds); -extern void rxi_CleanupConnection(struct rx_connection *conn); extern void rxi_DestroyConnection(struct rx_connection *conn); extern void rx_GetConnection(struct rx_connection *conn); extern void rx_DestroyConnection(struct rx_connection *conn); extern struct rx_call *rx_NewCall(struct rx_connection *conn); -extern int rxi_HasActiveCalls(struct rx_connection *aconn); extern int rxi_GetCallNumberVector(struct rx_connection *aconn, afs_int32 * aint32s); extern int rxi_SetCallNumberVector(struct rx_connection *aconn, @@ -85,11 +80,6 @@ extern afs_int32 rx_EndCall(struct rx_call *call, afs_int32 rc); extern void rx_InterruptCall(struct rx_call *call, afs_int32 error); extern void rx_Finalize(void); extern void rxi_PacketsUnWait(void); -extern struct rx_service *rxi_FindService(osi_socket socket, - u_short serviceId); -extern struct rx_call *rxi_NewCall(struct rx_connection *conn, - int channel); -extern void rxi_FreeCall(struct rx_call *call, int haveCTLock); extern void *rxi_Alloc(size_t size); extern void rxi_Free(void *addr, size_t size); extern void rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host, @@ -150,9 +140,6 @@ extern void rxi_ResetCall(struct rx_call *call, extern struct rx_packet *rxi_SendAck(struct rx_call *call, struct rx_packet *optionalPacket, int serial, int reason, int istack); -extern void rxi_StartUnlocked(struct rxevent *event, - void *call, /* struct rx_call */ - void *arg1, int istack); extern void rxi_Start(struct rxevent *event, void *call, /* struct rx_call */ void *arg1, int istack); @@ -608,8 +595,6 @@ extern int rxi_WriteProc(struct rx_call *call, char *buf, extern int rx_WriteProc(struct rx_call *call, char *buf, int nbytes); extern int rx_WriteProc32(struct rx_call *call, afs_int32 * value); -extern int rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, - int maxio, int nbytes); extern int rx_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, int nbytes); extern int rxi_WritevProc(struct rx_call *call, struct iovec *iov, int nio, diff --git a/src/rx/rx_rdwr.c b/src/rx/rx_rdwr.c index 61025ee..9971f4b 100644 --- a/src/rx/rx_rdwr.c +++ b/src/rx/rx_rdwr.c @@ -944,7 +944,7 @@ rx_WriteProc32(struct rx_call *call, afs_int32 * value) * LOCKS USED -- called at netpri. */ -int +static int rxi_WritevAlloc(struct rx_call *call, struct iovec *iov, int *nio, int maxio, int nbytes) { -- 1.9.4