rx: add post RPC procedure capability

Add the ability to specify a procedure that will be called after
the end of each RPC for a service.  This is similar to the
existing afterProc, except that it gets called after the RPC
has ended (after EndCall).

rx_SetPostProc and rx_GetPostProc are provided to set and retrieve
a postProc for a specified service.

Change-Id: I52e70323c5d35c9c0d70d9b9bbb05ff56a6edcad
Reviewed-on: http://gerrit.openafs.org/5529
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
This commit is contained in:
Marc Dionne 2011-09-28 21:15:32 -04:00 committed by Jeffrey Altman
parent 2fd66404d9
commit 5587bbfc0b
2 changed files with 7 additions and 0 deletions

View File

@ -1851,6 +1851,10 @@ rxi_ServerProc(int threadID, struct rx_call *newcall, osi_socket * socketp)
(*tservice->afterProc) (call, code);
rx_EndCall(call, code);
if (tservice->postProc)
(*tservice->postProc) (code);
if (rx_stats_active) {
MUTEX_ENTER(&rx_stats_mutex);
rxi_nCalls++;

View File

@ -152,6 +152,8 @@ rx_IsLoopbackAddr(afs_uint32 addr)
#define rx_SetBeforeProc(service,proc) ((service)->beforeProc = (proc))
#define rx_GetAfterProc(service) ((service)->afterProc)
#define rx_GetBeforeProc(service) ((service)->beforeProc)
#define rx_SetPostProc(service,proc) ((service)->postProc = (proc))
#define rx_GetPostProc(service) ((service)->postProc)
/* Define a procedure to be called when a server connection is created */
#define rx_SetNewConnProc(service, proc) ((service)->newConnProc = (proc))
@ -315,6 +317,7 @@ struct rx_service {
void (*newConnProc) (struct rx_connection * tcon); /* Routine to call when a server connection is created */
void (*beforeProc) (struct rx_call * acall); /* routine to call before a call is executed */
void (*afterProc) (struct rx_call * acall, afs_int32 code); /* routine to call after a call is executed */
void (*postProc) (afs_int32 code); /* routine to call after the call has ended */
u_short maxProcs; /* Maximum procs to be used for this service */
u_short minProcs; /* Minimum # of requests guaranteed executable simultaneously */
u_short connDeadTime; /* Seconds until a client of this service will be declared dead, if it is not responding */