From: Marc Dionne Date: Thu, 29 Sep 2011 01:15:32 +0000 (-0400) Subject: rx: add post RPC procedure capability X-Git-Tag: openafs-stable-1_8_0pre1~3209 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=5587bbfc0bc70de234e5655faf7676cf2b9b9715 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 Reviewed-by: Jeffrey Altman --- diff --git a/src/rx/rx.c b/src/rx/rx.c index baec518..b6a1316 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -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++; diff --git a/src/rx/rx.h b/src/rx/rx.h index f8f189e..0014178 100644 --- a/src/rx/rx.h +++ b/src/rx/rx.h @@ -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 */