From 91c2826e1d812156caf51482bb8436af0345897b Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 2 Aug 2018 15:56:36 +0200 Subject: [PATCH] CLEANUP: server: remove the update list and the update lock These ones are not more used, let's get rid of them. --- include/common/hathreads.h | 1 - include/proto/server.h | 3 --- include/types/server.h | 1 - src/server.c | 22 ---------------------- 4 files changed, 27 deletions(-) diff --git a/include/common/hathreads.h b/include/common/hathreads.h index d1dcbbf446..794fa8b6c1 100644 --- a/include/common/hathreads.h +++ b/include/common/hathreads.h @@ -353,7 +353,6 @@ enum lock_label { LISTENER_QUEUE_LOCK, PROXY_LOCK, SERVER_LOCK, - UPDATED_SERVERS_LOCK, LBPRM_LOCK, SIGNALS_LOCK, STK_TABLE_LOCK, diff --git a/include/proto/server.h b/include/proto/server.h index dedb17f153..1c2d1fdaff 100644 --- a/include/proto/server.h +++ b/include/proto/server.h @@ -50,9 +50,6 @@ void srv_compute_all_admin_states(struct proxy *px); int srv_set_addr_via_libc(struct server *srv, int *err_code); int srv_init_addr(void); struct server *cli_find_server(struct appctx *appctx, char *arg); -void servers_update_status(void); - -extern struct list updated_servers; /* functions related to server name resolution */ int snr_update_srv_status(struct server *s, int has_no_ip); diff --git a/include/types/server.h b/include/types/server.h index 0cd20c0965..c30003bdbe 100644 --- a/include/types/server.h +++ b/include/types/server.h @@ -311,7 +311,6 @@ struct server { int nb_low; int nb_high; } tmpl_info; - struct list update_status; /* to attach to list of servers chnaging status */ struct { long duration; short status, code; diff --git a/src/server.c b/src/server.c index d9b304a2b6..c5e8945374 100644 --- a/src/server.c +++ b/src/server.c @@ -44,9 +44,6 @@ #include #include -struct list updated_servers = LIST_HEAD_INIT(updated_servers); -__decl_hathreads(HA_SPINLOCK_T updated_servers_lock); - static void srv_update_status(struct server *s); static void srv_update_state(struct server *srv, int version, char **params); static int srv_apply_lastaddr(struct server *srv, int *err_code); @@ -1618,8 +1615,6 @@ static struct server *new_server(struct proxy *proxy) LIST_INIT(&srv->safe_conns[i]); } - LIST_INIT(&srv->update_status); - srv->next_state = SRV_ST_RUNNING; /* early server setup */ srv->last_change = now.tv_sec; @@ -4522,7 +4517,6 @@ static struct cli_kw_list cli_kws = {{ },{ __attribute__((constructor)) static void __server_init(void) { - HA_SPIN_INIT(&updated_servers_lock); cli_register_kw(&cli_kws); } @@ -5060,22 +5054,6 @@ static void srv_update_status(struct server *s) /* Re-set log strings to empty */ *s->adm_st_chg_cause = 0; } -/* - * This function loops on servers registered for asynchronous - * status changes - * - * NOTE: No needs to lock list because it is called inside the - * sync point. - */ -void servers_update_status(void) { - struct server *s, *stmp; - - list_for_each_entry_safe(s, stmp, &updated_servers, update_status) { - srv_update_status(s); - LIST_DEL(&s->update_status); - LIST_INIT(&s->update_status); - } -} /* * Local variables: -- 2.39.5