From 6233929f722f656c41752eb1f46acb39d4511690 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 24 Mar 2020 14:35:51 +0100 Subject: lib: Remove unused elements from ctdbd_connection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Nobody set them, only the destructor referenced them Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Tue Apr 28 10:46:22 UTC 2020 on sn-devel-184 --- source3/lib/ctdbd_conn.c | 76 ------------------------------------------------ 1 file changed, 76 deletions(-) (limited to 'source3/lib/ctdbd_conn.c') diff --git a/source3/lib/ctdbd_conn.c b/source3/lib/ctdbd_conn.c index 442c665ef29..f258f1109ed 100644 --- a/source3/lib/ctdbd_conn.c +++ b/source3/lib/ctdbd_conn.c @@ -50,9 +50,6 @@ struct ctdbd_srvid_cb { void *private_data; }; -struct ctdb_pkt_send_state; -struct ctdb_pkt_recv_state; - struct ctdbd_connection { uint32_t reqid; uint32_t our_vnn; @@ -61,24 +58,6 @@ struct ctdbd_connection { int fd; int timeout; - /* State to track in-progress read */ - struct ctdb_read_state { - /* Receive buffer for the initial packet length */ - uint32_t msglen; - - /* iovec state for current read */ - struct iovec iov; - struct iovec *iovs; - int iovcnt; - - /* allocated receive buffer based on packet length */ - struct ctdb_req_header *hdr; - } read_state; - - /* Lists of pending async reads and writes */ - struct ctdb_pkt_recv_state *recv_list; - struct ctdb_pkt_send_state *send_list; - /* * Outgoing queue for writev_send of asynchronous ctdb requests */ @@ -1267,67 +1246,12 @@ int ctdbd_probe(const char *sockname, int timeout) return ret; } -struct ctdb_pkt_send_state { - struct ctdb_pkt_send_state *prev, *next; - struct tevent_context *ev; - struct ctdbd_connection *conn; - - /* ctdb request id */ - uint32_t reqid; - - /* the associated tevent request */ - struct tevent_req *req; - - /* iovec array with data to send */ - struct iovec _iov; - struct iovec *iov; - int iovcnt; - - /* Initial packet length */ - size_t packet_len; -}; - -struct ctdb_pkt_recv_state { - struct ctdb_pkt_recv_state *prev, *next; - struct tevent_context *ev; - struct ctdbd_connection *conn; - - /* ctdb request id */ - uint32_t reqid; - - /* the associated tevent_req */ - struct tevent_req *req; - - /* pointer to allocated ctdb packet buffer */ - struct ctdb_req_header *hdr; -}; - static int ctdbd_connection_destructor(struct ctdbd_connection *c) { if (c->fd != -1) { close(c->fd); c->fd = -1; } - - TALLOC_FREE(c->read_state.hdr); - ZERO_STRUCT(c->read_state); - - while (c->send_list != NULL) { - struct ctdb_pkt_send_state *send_state = c->send_list; - DLIST_REMOVE(c->send_list, send_state); - send_state->conn = NULL; - tevent_req_defer_callback(send_state->req, send_state->ev); - tevent_req_error(send_state->req, EIO); - } - - while (c->recv_list != NULL) { - struct ctdb_pkt_recv_state *recv_state = c->recv_list; - DLIST_REMOVE(c->recv_list, recv_state); - recv_state->conn = NULL; - tevent_req_defer_callback(recv_state->req, recv_state->ev); - tevent_req_error(recv_state->req, EIO); - } - return 0; } -- cgit v1.2.1