MINOR: server: rename <all_servers> list to <servers_to_init> · haproxy/haproxy@c698e8b · GitHub
Skip to content

Commit c698e8b

Browse files
committed
MINOR: server: rename <all_servers> list to <servers_to_init>
Now that <all_servers> is only used during postparsing, it is better to rename it <servers_to_init> to reflect its real purpose. The attach point in struct server is also renamed to <el_alt> for "alternative attach point". This is a generic name as it will be reused for another list storage during runtime.
1 parent be19748 commit c698e8b

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

‎include/haproxy/server-t.h‎

Lines changed: 3 additions & 1 deletion

‎include/haproxy/server.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
extern struct idle_conns idle_conns[MAX_THREADS];
4545
extern struct task *idle_conn_task[MAX_THREADS];
4646
extern struct eb_root idle_conn_srv[MAX_THREADS];
47-
extern struct list all_servers;
47+
extern struct list servers_to_init;
4848
extern struct dict server_key_dict;
4949

5050
int srv_downtime(const struct server *s);
@@ -402,7 +402,7 @@ static inline void srv_detach(struct server *srv)
402402

403403
if (global.mode & MODE_STARTING) {
404404
/* Necessary if startup is interrupted due to an early error before check_config_validity(). */
405-
LIST_DEL_INIT(&srv->global_list);
405+
LIST_DEL_INIT(&srv->el_alt);
406406
}
407407

408408
/* Reset the proxy's ready_srv if it was this one. */

‎src/cfgparse.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2383,11 +2383,11 @@ int check_config_validity()
23832383
* we must finish to initialize certain things on the servers,
23842384
* as some of the fields may be accessed soon
23852385
*/
2386-
list_for_each_entry_safe(newsrv, tmpsrv, &all_servers, global_list) {
2386+
list_for_each_entry_safe(newsrv, tmpsrv, &servers_to_init, el_alt) {
23872387
err_code |= srv_preinit(newsrv);
23882388
if (err_code & ERR_CODE)
23892389
goto out;
2390-
LIST_DEL_INIT(&newsrv->global_list);
2390+
LIST_DEL_INIT(&newsrv->el_alt);
23912391
}
23922392

23932393
list_for_each_entry(defpx, &defaults_list, el) {

‎src/haload.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2373,8 +2373,8 @@ static int hld_cfg_finalize(void)
23732373
if (srv_preinit(srv))
23742374
goto leave;
23752375

2376-
/* No need to stay in <all_servers> as srv_preinit() is manually called. */
2377-
LIST_DEL_INIT(&srv->global_list);
2376+
/* No need to stay in <servers_to_init> as srv_preinit() is manually called. */
2377+
LIST_DEL_INIT(&srv->el_alt);
23782378

23792379
#if 0
23802380
/* XXX Must this be done? XXX */

‎src/server.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ struct srv_kw_list srv_keywords = {
7979

8080
struct eb_root idle_conn_srv[MAX_THREADS];
8181
struct task *idle_conn_task[MAX_THREADS] __read_mostly = {};
82-
struct list all_servers = LIST_HEAD_INIT(all_servers);
82+
struct list servers_to_init = LIST_HEAD_INIT(servers_to_init);
8383
static struct task *server_atomic_sync_task = NULL;
8484
static event_hdl_async_equeue server_atomic_sync_queue;
8585

@@ -3209,9 +3209,9 @@ struct server *new_server(struct proxy *proxy)
32093209

32103210
HA_RWLOCK_INIT(&srv->path_params.param_lock);
32113211

3212-
LIST_INIT(&srv->global_list);
3212+
LIST_INIT(&srv->el_alt);
32133213
if (global.mode & MODE_STARTING)
3214-
LIST_APPEND(&all_servers, &srv->global_list);
3214+
LIST_APPEND(&servers_to_init, &srv->el_alt);
32153215

32163216
return srv;
32173217
}

‎src/sink.c‎

Lines changed: 2 additions & 2 deletions

0 commit comments

Comments
 (0)