From 01a1b79288c532f99e2da52aa13262d4c0fc1f79 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 7 Dec 2011 18:30:00 +0000 Subject: [PATCH] rx: rxi_AckAll isn't an event handler rxi_AckAll is coded as if it is an event handler, yet the only call site is a direct call from rx.c. So, rework the function to remove all of the event handling code, change its arguments to match, and make it static. Change-Id: I947c02bf91bf5a3f42d2a389f9393e68f3ccee4b Reviewed-on: http://gerrit.openafs.org/6999 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/rx/rx.c | 31 ++++++------------------------- src/rx/rx_call.h | 1 - 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/src/rx/rx.c b/src/rx/rx.c index 0708160d3..ee134bb21 100644 --- a/src/rx/rx.c +++ b/src/rx/rx.c @@ -116,8 +116,7 @@ static void rxi_ReapConnections(struct rxevent *unused, void *unused1, static struct rx_packet *rxi_SendCallAbort(struct rx_call *call, struct rx_packet *packet, int istack, int force); -static void rxi_AckAll(struct rxevent *event, struct rx_call *call, - char *dummy); +static void rxi_AckAll(struct rx_call *call); static struct rx_connection *rxi_FindConnection(osi_socket socket, afs_uint32 host, u_short port, u_short serviceId, afs_uint32 cid, @@ -1299,7 +1298,7 @@ rxi_DestroyConnectionNoLock(struct rx_connection *conn) || call->state == RX_STATE_ACTIVE) { rxi_SendAck(call, 0, 0, RX_ACK_DELAY, 0); } else { - rxi_AckAll(NULL, call, 0); + rxi_AckAll(call); } } MUTEX_EXIT(&call->lock); @@ -4915,30 +4914,12 @@ rxi_AttachServerProc(struct rx_call *call, * a new call is being prepared (in the case of a client) or a reply * is being prepared (in the case of a server). Rather than sending * an ack packet, an ACKALL packet is sent. */ -void -rxi_AckAll(struct rxevent *event, struct rx_call *call, char *dummy) +static void +rxi_AckAll(struct rx_call *call) { -#ifdef RX_ENABLE_LOCKS - if (event) { - MUTEX_ENTER(&call->lock); - rxevent_Put(call->delayedAckEvent); - call->delayedAckEvent = NULL; - CALL_RELE(call, RX_CALL_REFCOUNT_ACKALL); - } - rxi_SendSpecial(call, call->conn, (struct rx_packet *)0, - RX_PACKET_TYPE_ACKALL, NULL, 0, 0); + rxi_SendSpecial(call, call->conn, NULL, RX_PACKET_TYPE_ACKALL, + NULL, 0, 0); call->flags |= RX_CALL_ACKALL_SENT; - if (event) - MUTEX_EXIT(&call->lock); -#else /* RX_ENABLE_LOCKS */ - if (event) { - rxevent_Put(call->delayedAckEvent); - call->delayedAckEvent = NULL; - } - rxi_SendSpecial(call, call->conn, (struct rx_packet *)0, - RX_PACKET_TYPE_ACKALL, NULL, 0, 0); - call->flags |= RX_CALL_ACKALL_SENT; -#endif /* RX_ENABLE_LOCKS */ } static void diff --git a/src/rx/rx_call.h b/src/rx/rx_call.h index ce52f1869..08fc1f028 100644 --- a/src/rx/rx_call.h +++ b/src/rx/rx_call.h @@ -118,7 +118,6 @@ struct rx_call { #define RX_CALL_REFCOUNT_ALIVE 3 /* keep alive event */ #define RX_CALL_REFCOUNT_PACKET 4 /* waiting for packets. */ #define RX_CALL_REFCOUNT_SEND 5 /* rxi_Send */ -#define RX_CALL_REFCOUNT_ACKALL 6 /* rxi_AckAll */ #define RX_CALL_REFCOUNT_ABORT 7 /* delayed abort */ #define RX_CALL_REFCOUNT_MTU 8 /* grow mtu event */ #define RX_CALL_REFCOUNT_MAX 9 /* array size. */ -- 2.39.5