diff --git a/addons/51degrees/51d.c b/addons/51degrees/51d.c index 2c52c597c0..6dfa578e24 100644 --- a/addons/51degrees/51d.c +++ b/addons/51degrees/51d.c @@ -91,7 +91,7 @@ static int _51d_property_name_list(char **args, int section_type, struct proxy * while (*(args[cur_arg])) { name = calloc(1, sizeof(*name)); name->name = strdup(args[cur_arg]); - LIST_ADDQ(&global_51degrees.property_names, &name->list); + LIST_APPEND(&global_51degrees.property_names, &name->list); ++cur_arg; } @@ -730,7 +730,7 @@ static void deinit_51degrees(void) ha_free(&global_51degrees.data_file_path); list_for_each_entry_safe(_51d_prop_name, _51d_prop_nameb, &global_51degrees.property_names, list) { - LIST_DEL(&_51d_prop_name->list); + LIST_DELETE(&_51d_prop_name->list); free(_51d_prop_name); } diff --git a/addons/ot/include/define.h b/addons/ot/include/define.h index 8769161733..d34f6b9f28 100644 --- a/addons/ot/include/define.h +++ b/addons/ot/include/define.h @@ -53,7 +53,7 @@ #define FLT_OT_RUN_ONCE(f) do { static bool __f = 1; if (__f) { __f = 0; f; } } while (0) #define FLT_OT_LIST_ISVALID(a) (((a) != NULL) && ((a)->n != NULL) && ((a)->p != NULL)) -#define FLT_OT_LIST_DEL(a) do { if (FLT_OT_LIST_ISVALID(a)) LIST_DEL(a); } while (0) +#define FLT_OT_LIST_DEL(a) do { if (FLT_OT_LIST_ISVALID(a)) LIST_DELETE(a); } while (0) #define FLT_OT_LIST_DESTROY(t,h) \ do { \ struct flt_ot_conf_##t *_ptr, *_back; \ diff --git a/addons/ot/src/conf.c b/addons/ot/src/conf.c index 626d418bd8..71db967754 100644 --- a/addons/ot/src/conf.c +++ b/addons/ot/src/conf.c @@ -67,7 +67,7 @@ static void *flt_ot_conf_hdr_init(size_t size, const char *id, int linenum, stru retptr->cfg_line = linenum; if (head != NULL) - LIST_ADDQ(head, &(retptr->list)); + LIST_APPEND(head, &(retptr->list)); } else { FLT_OT_ERR("out of memory"); } @@ -680,7 +680,7 @@ void flt_ot_conf_tracer_free(struct flt_ot_conf_tracer **ptr) } FLT_OT_DBG(2, "- deleting proxy_log.logsrvs list %s", flt_ot_list_debug(&((*ptr)->proxy_log.logsrvs))); list_for_each_entry_safe(logsrv, logsrvback, &((*ptr)->proxy_log.logsrvs), list) { - LIST_DEL(&(logsrv->list)); + LIST_DELETE(&(logsrv->list)); FLT_OT_FREE(logsrv); } FLT_OT_LIST_DESTROY(ph_group, &((*ptr)->ph_groups)); diff --git a/addons/ot/src/scope.c b/addons/ot/src/scope.c index ace8a229e0..8305f24d22 100644 --- a/addons/ot/src/scope.c +++ b/addons/ot/src/scope.c @@ -256,7 +256,7 @@ struct flt_ot_scope_span *flt_ot_scope_span_init(struct flt_ot_runtime_context * retptr->ref_type = ref_type; retptr->ref_span = ref_span; retptr->ref_ctx = ref_ctx; - LIST_ADD(&(rt_ctx->spans), &(retptr->list)); + LIST_INSERT(&(rt_ctx->spans), &(retptr->list)); FLT_OT_DBG_SCOPE_SPAN("new span ", retptr); @@ -352,7 +352,7 @@ struct flt_ot_scope_context *flt_ot_scope_context_init(struct flt_ot_runtime_con retptr->id_len = id_len; retptr->smp_opt_dir = dir; retptr->context = span_ctx; - LIST_ADD(&(rt_ctx->contexts), &(retptr->list)); + LIST_INSERT(&(rt_ctx->contexts), &(retptr->list)); FLT_OT_DBG_SCOPE_CONTEXT("new context ", retptr); diff --git a/addons/wurfl/wurfl.c b/addons/wurfl/wurfl.c index 8ec17836d1..e9780e4787 100644 --- a/addons/wurfl/wurfl.c +++ b/addons/wurfl/wurfl.c @@ -204,7 +204,7 @@ static int ha_wurfl_cfg_information_list(char **args, int section_type, struct p wi->data.name = strdup(args[argIdx]); wi->data.type = HA_WURFL_DATA_TYPE_UNKNOWN; wi->data.func_callback = NULL; - LIST_ADDQ(&global_wurfl.information_list, &wi->list); + LIST_APPEND(&global_wurfl.information_list, &wi->list); ++argIdx; } @@ -232,7 +232,7 @@ static int ha_wurfl_cfg_patch_file_list(char **args, int section_type, struct pr } wp->patch_file_path = strdup(args[argIdx]); - LIST_ADDQ(&global_wurfl.patch_file_list, &wp->list); + LIST_APPEND(&global_wurfl.patch_file_list, &wp->list); ++argIdx; } @@ -410,12 +410,12 @@ static void ha_wurfl_deinit(void) ha_free(&global_wurfl.cache_size); list_for_each_entry_safe(wi, wi2, &global_wurfl.information_list, list) { - LIST_DEL(&wi->list); + LIST_DELETE(&wi->list); free(wi); } list_for_each_entry_safe(wp, wp2, &global_wurfl.patch_file_list, list) { - LIST_DEL(&wp->list); + LIST_DELETE(&wp->list); free(wp); } diff --git a/contrib/mod_defender/include/haproxy/list.h b/contrib/mod_defender/include/haproxy/list.h index 0efe4e9257..cbff73f8b9 100644 --- a/contrib/mod_defender/include/haproxy/list.h +++ b/contrib/mod_defender/include/haproxy/list.h @@ -44,10 +44,10 @@ #define LIST_HEAD_INIT(l) { &l, &l } /* adds an element at the beginning of a list ; returns the element */ -#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) +#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) /* adds an element at the end of a list ; returns the element */ -#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) +#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) /* adds the contents of a list at the beginning of another list . The old list head remains untouched. */ #define LIST_SPLICE(new, old) do { \ @@ -71,10 +71,10 @@ } while (0) /* removes an element from a list and returns it */ -#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) +#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) /* removes an element from a list, initializes it and returns it. - * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers. + * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers. */ #define LIST_DEL_INIT(el) ({ \ typeof(el) __ret = (el); \ @@ -98,7 +98,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define LIST_ADDED(el) ((el)->n != (el)) +#define LIST_INLIST(el) ((el)->n != (el)) /* returns a pointer of type to a structure following the element * which contains list head , which is known as element in @@ -224,7 +224,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADD(_lh, _el) \ +#define MT_LIST_TRY_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -283,7 +283,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADDQ(_lh, _el) \ +#define MT_LIST_TRY_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -341,7 +341,7 @@ * Add an item at the beginning of a list. * It is assumed the element can't already be in a list, so it isn't checked. */ -#define MT_LIST_ADD(_lh, _el) \ +#define MT_LIST_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -374,7 +374,7 @@ * Add an item at the end of a list. * It is assumed the element can't already be in a list, so it isn't checked */ -#define MT_LIST_ADDQ(_lh, _el) \ +#define MT_LIST_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -406,8 +406,8 @@ /* * Detach a list from its head. A pointer to the first element is returned * and the list is closed. If the list was empty, NULL is returned. This may - * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This - * is incompatible with MT_LIST_DEL run concurrently. + * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This + * is incompatible with MT_LIST_DELETE run concurrently. * If there's at least one element, the next of the last element will always * be NULL. */ @@ -454,7 +454,7 @@ /* Remove an item from a list. * Returns 1 if we removed the item, 0 otherwise (because it was in no list). */ -#define MT_LIST_DEL(_el) \ +#define MT_LIST_DELETE(_el) \ ({ \ int _ret = 0; \ struct mt_list *el = (_el); \ @@ -589,7 +589,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define MT_LIST_ADDED(el) ((el)->next != (el)) +#define MT_LIST_INLIST(el) ((el)->next != (el)) /* Lock an element in the list, to be sure it won't be removed. * It needs to be synchronized somehow to be sure it's not removed @@ -722,10 +722,10 @@ p->next = n; \ } while (0); -/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe(). +/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe(). * It should be the element currently parsed (tmpelt1) */ -#define MT_LIST_DEL_SAFE(_el) \ +#define MT_LIST_DELETE_SAFE(_el) \ do { \ struct mt_list *el = (_el); \ (el)->prev = (el); \ @@ -733,8 +733,8 @@ (_el) = NULL; \ } while (0) -/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */ -#define MT_LIST_DEL_SAFE_NOINIT(_el) \ +/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */ +#define MT_LIST_DELETE_SAFE_NOINIT(_el) \ do { \ (_el) = NULL; \ } while (0) @@ -745,10 +745,10 @@ * the list is passed in . A temporary variable of same type * as is needed so that may safely be deleted if needed. * tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary - * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE. + * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE. * Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2) * { ... }; - * If you want to remove the current element, please use MT_LIST_DEL_SAFE. + * If you want to remove the current element, please use MT_LIST_DELETE_SAFE. */ #define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \ for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \ diff --git a/contrib/mod_defender/spoa.c b/contrib/mod_defender/spoa.c index e96b95e74a..c554da8de5 100644 --- a/contrib/mod_defender/spoa.c +++ b/contrib/mod_defender/spoa.c @@ -967,11 +967,11 @@ release_frame(struct spoe_frame *frame) event_del(&frame->process_frame_event); worker = frame->worker; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); if (frame->frag_buf) free(frame->frag_buf); memset(frame, 0, sizeof(*frame)+max_frame_size+4); - LIST_ADDQ(&worker->frames, &frame->list); + LIST_APPEND(&worker->frames, &frame->list); } static void @@ -984,7 +984,7 @@ release_client(struct client *c) DEBUG(c->worker, "<%lu> Release client", c->id); - LIST_DEL(&c->by_worker); + LIST_DELETE(&c->by_worker); c->worker->nbclients--; unuse_spoe_engine(c); @@ -1056,12 +1056,12 @@ use_spoe_engine(struct client *client) LIST_INIT(&eng->clients); LIST_INIT(&eng->processing_frames); LIST_INIT(&eng->outgoing_frames); - LIST_ADDQ(&client->worker->engines, &eng->list); + LIST_APPEND(&client->worker->engines, &eng->list); LOG(client->worker, "Add new SPOE engine '%s'", eng->id); end: client->engine = eng; - LIST_ADDQ(&eng->clients, &client->by_engine); + LIST_APPEND(&eng->clients, &client->by_engine); } static void @@ -1075,12 +1075,12 @@ unuse_spoe_engine(struct client *client) eng = client->engine; client->engine = NULL; - LIST_DEL(&client->by_engine); + LIST_DELETE(&client->by_engine); if (!LIST_ISEMPTY(&eng->clients)) return; LOG(client->worker, "Remove SPOE engine '%s'", eng->id); - LIST_DEL(&eng->list); + LIST_DELETE(&eng->list); list_for_each_entry_safe(frame, back, &eng->processing_frames, list) { release_frame(frame); @@ -1110,7 +1110,7 @@ acquire_incoming_frame(struct client *client) } else { frame = LIST_NEXT(&client->worker->frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); } reset_frame(frame); @@ -1138,12 +1138,12 @@ acquire_outgoing_frame(struct client *client) frame = client->outgoing_frame; else if (!LIST_ISEMPTY(&client->outgoing_frames)) { frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) { frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } return frame; @@ -1154,7 +1154,7 @@ write_frame(struct client *client, struct spoe_frame *frame) { uint32_t netint; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); frame->buf = (char *)(frame->data); frame->offset = 0; @@ -1170,7 +1170,7 @@ write_frame(struct client *client, struct spoe_frame *frame) if (client->outgoing_frame == NULL) client->outgoing_frame = frame; else - LIST_ADD(&client->outgoing_frames, &frame->list); + LIST_INSERT(&client->outgoing_frames, &frame->list); } else { client->outgoing_frame = frame; @@ -1179,12 +1179,12 @@ write_frame(struct client *client, struct spoe_frame *frame) } else { /* for all other frames */ if (frame->client == NULL) { /* async mode ! */ - LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list); + LIST_APPEND(&frame->engine->outgoing_frames, &frame->list); list_for_each_entry(client, &frame->engine->clients, by_engine) event_add(&client->write_frame_event, NULL); } else if (frame->client->pipelining) { - LIST_ADDQ(&frame->client->outgoing_frames, &frame->list); + LIST_APPEND(&frame->client->outgoing_frames, &frame->list); event_add(&frame->client->write_frame_event, NULL); } else { @@ -1208,10 +1208,10 @@ process_incoming_frame(struct spoe_frame *frame) if (client->async) { frame->client = NULL; - LIST_ADDQ(&frame->engine->processing_frames, &frame->list); + LIST_APPEND(&frame->engine->processing_frames, &frame->list); } else if (client->pipelining) - LIST_ADDQ(&client->processing_frames, &frame->list); + LIST_APPEND(&client->processing_frames, &frame->list); else event_del(&client->read_frame_event); } @@ -1603,7 +1603,7 @@ accept_cb(int listener, short event, void *arg) LIST_INIT(&client->processing_frames); LIST_INIT(&client->outgoing_frames); - LIST_ADDQ(&worker->clients, &client->by_worker); + LIST_APPEND(&worker->clients, &client->by_worker); worker->nbclients++; @@ -1633,7 +1633,7 @@ worker_function(void *data) } list_for_each_entry_safe(frame, fback, &worker->frames, list) { - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); free(frame); } diff --git a/contrib/modsecurity/include/haproxy/list.h b/contrib/modsecurity/include/haproxy/list.h index 0efe4e9257..cbff73f8b9 100644 --- a/contrib/modsecurity/include/haproxy/list.h +++ b/contrib/modsecurity/include/haproxy/list.h @@ -44,10 +44,10 @@ #define LIST_HEAD_INIT(l) { &l, &l } /* adds an element at the beginning of a list ; returns the element */ -#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) +#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) /* adds an element at the end of a list ; returns the element */ -#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) +#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) /* adds the contents of a list at the beginning of another list . The old list head remains untouched. */ #define LIST_SPLICE(new, old) do { \ @@ -71,10 +71,10 @@ } while (0) /* removes an element from a list and returns it */ -#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) +#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) /* removes an element from a list, initializes it and returns it. - * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers. + * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers. */ #define LIST_DEL_INIT(el) ({ \ typeof(el) __ret = (el); \ @@ -98,7 +98,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define LIST_ADDED(el) ((el)->n != (el)) +#define LIST_INLIST(el) ((el)->n != (el)) /* returns a pointer of type to a structure following the element * which contains list head , which is known as element in @@ -224,7 +224,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADD(_lh, _el) \ +#define MT_LIST_TRY_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -283,7 +283,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADDQ(_lh, _el) \ +#define MT_LIST_TRY_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -341,7 +341,7 @@ * Add an item at the beginning of a list. * It is assumed the element can't already be in a list, so it isn't checked. */ -#define MT_LIST_ADD(_lh, _el) \ +#define MT_LIST_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -374,7 +374,7 @@ * Add an item at the end of a list. * It is assumed the element can't already be in a list, so it isn't checked */ -#define MT_LIST_ADDQ(_lh, _el) \ +#define MT_LIST_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -406,8 +406,8 @@ /* * Detach a list from its head. A pointer to the first element is returned * and the list is closed. If the list was empty, NULL is returned. This may - * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This - * is incompatible with MT_LIST_DEL run concurrently. + * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This + * is incompatible with MT_LIST_DELETE run concurrently. * If there's at least one element, the next of the last element will always * be NULL. */ @@ -454,7 +454,7 @@ /* Remove an item from a list. * Returns 1 if we removed the item, 0 otherwise (because it was in no list). */ -#define MT_LIST_DEL(_el) \ +#define MT_LIST_DELETE(_el) \ ({ \ int _ret = 0; \ struct mt_list *el = (_el); \ @@ -589,7 +589,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define MT_LIST_ADDED(el) ((el)->next != (el)) +#define MT_LIST_INLIST(el) ((el)->next != (el)) /* Lock an element in the list, to be sure it won't be removed. * It needs to be synchronized somehow to be sure it's not removed @@ -722,10 +722,10 @@ p->next = n; \ } while (0); -/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe(). +/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe(). * It should be the element currently parsed (tmpelt1) */ -#define MT_LIST_DEL_SAFE(_el) \ +#define MT_LIST_DELETE_SAFE(_el) \ do { \ struct mt_list *el = (_el); \ (el)->prev = (el); \ @@ -733,8 +733,8 @@ (_el) = NULL; \ } while (0) -/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */ -#define MT_LIST_DEL_SAFE_NOINIT(_el) \ +/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */ +#define MT_LIST_DELETE_SAFE_NOINIT(_el) \ do { \ (_el) = NULL; \ } while (0) @@ -745,10 +745,10 @@ * the list is passed in . A temporary variable of same type * as is needed so that may safely be deleted if needed. * tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary - * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE. + * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE. * Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2) * { ... }; - * If you want to remove the current element, please use MT_LIST_DEL_SAFE. + * If you want to remove the current element, please use MT_LIST_DELETE_SAFE. */ #define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \ for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \ diff --git a/contrib/modsecurity/spoa.c b/contrib/modsecurity/spoa.c index 37564055ce..e550d5f283 100644 --- a/contrib/modsecurity/spoa.c +++ b/contrib/modsecurity/spoa.c @@ -972,11 +972,11 @@ release_frame(struct spoe_frame *frame) event_del(&frame->process_frame_event); worker = frame->worker; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); if (frame->frag_buf) free(frame->frag_buf); memset(frame, 0, sizeof(*frame)+max_frame_size+4); - LIST_ADDQ(&worker->frames, &frame->list); + LIST_APPEND(&worker->frames, &frame->list); } static void @@ -989,7 +989,7 @@ release_client(struct client *c) DEBUG(c->worker, "<%lu> Release client", c->id); - LIST_DEL(&c->by_worker); + LIST_DELETE(&c->by_worker); c->worker->nbclients--; unuse_spoe_engine(c); @@ -1061,12 +1061,12 @@ use_spoe_engine(struct client *client) LIST_INIT(&eng->clients); LIST_INIT(&eng->processing_frames); LIST_INIT(&eng->outgoing_frames); - LIST_ADDQ(&client->worker->engines, &eng->list); + LIST_APPEND(&client->worker->engines, &eng->list); LOG(client->worker, "Add new SPOE engine '%s'", eng->id); end: client->engine = eng; - LIST_ADDQ(&eng->clients, &client->by_engine); + LIST_APPEND(&eng->clients, &client->by_engine); } static void @@ -1080,12 +1080,12 @@ unuse_spoe_engine(struct client *client) eng = client->engine; client->engine = NULL; - LIST_DEL(&client->by_engine); + LIST_DELETE(&client->by_engine); if (!LIST_ISEMPTY(&eng->clients)) return; LOG(client->worker, "Remove SPOE engine '%s'", eng->id); - LIST_DEL(&eng->list); + LIST_DELETE(&eng->list); list_for_each_entry_safe(frame, back, &eng->processing_frames, list) { release_frame(frame); @@ -1115,7 +1115,7 @@ acquire_incoming_frame(struct client *client) } else { frame = LIST_NEXT(&client->worker->frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); } reset_frame(frame); @@ -1143,12 +1143,12 @@ acquire_outgoing_frame(struct client *client) frame = client->outgoing_frame; else if (!LIST_ISEMPTY(&client->outgoing_frames)) { frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) { frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } return frame; @@ -1159,7 +1159,7 @@ write_frame(struct client *client, struct spoe_frame *frame) { uint32_t netint; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); frame->buf = (char *)(frame->data); frame->offset = 0; @@ -1175,7 +1175,7 @@ write_frame(struct client *client, struct spoe_frame *frame) if (client->outgoing_frame == NULL) client->outgoing_frame = frame; else - LIST_ADD(&client->outgoing_frames, &frame->list); + LIST_INSERT(&client->outgoing_frames, &frame->list); } else { client->outgoing_frame = frame; @@ -1184,12 +1184,12 @@ write_frame(struct client *client, struct spoe_frame *frame) } else { /* for all other frames */ if (frame->client == NULL) { /* async mode ! */ - LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list); + LIST_APPEND(&frame->engine->outgoing_frames, &frame->list); list_for_each_entry(client, &frame->engine->clients, by_engine) event_add(&client->write_frame_event, NULL); } else if (frame->client->pipelining) { - LIST_ADDQ(&frame->client->outgoing_frames, &frame->list); + LIST_APPEND(&frame->client->outgoing_frames, &frame->list); event_add(&frame->client->write_frame_event, NULL); } else { @@ -1213,10 +1213,10 @@ process_incoming_frame(struct spoe_frame *frame) if (client->async) { frame->client = NULL; - LIST_ADDQ(&frame->engine->processing_frames, &frame->list); + LIST_APPEND(&frame->engine->processing_frames, &frame->list); } else if (client->pipelining) - LIST_ADDQ(&client->processing_frames, &frame->list); + LIST_APPEND(&client->processing_frames, &frame->list); else event_del(&client->read_frame_event); } @@ -1632,7 +1632,7 @@ accept_cb(int listener, short event, void *arg) LIST_INIT(&client->processing_frames); LIST_INIT(&client->outgoing_frames); - LIST_ADDQ(&worker->clients, &client->by_worker); + LIST_APPEND(&worker->clients, &client->by_worker); worker->nbclients++; @@ -1662,7 +1662,7 @@ worker_function(void *data) } list_for_each_entry_safe(frame, fback, &worker->frames, list) { - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); free(frame); } diff --git a/contrib/spoa_example/include/mini-clist.h b/contrib/spoa_example/include/mini-clist.h index d009704cc2..bb0d84b053 100644 --- a/contrib/spoa_example/include/mini-clist.h +++ b/contrib/spoa_example/include/mini-clist.h @@ -31,13 +31,13 @@ struct list { #define LIST_HEAD_INIT(l) { &l, &l } /* adds an element at the beginning of a list ; returns the element */ -#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) +#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) /* adds an element at the end of a list ; returns the element */ -#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) +#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) /* removes an element from a list and returns it */ -#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) +#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) /* returns a pointer of type to a structure containing a list head called * at address . Note that can be the result of a function or macro diff --git a/contrib/spoa_example/spoa.c b/contrib/spoa_example/spoa.c index 3f96d849ac..ed22813a18 100644 --- a/contrib/spoa_example/spoa.c +++ b/contrib/spoa_example/spoa.c @@ -1024,11 +1024,11 @@ release_frame(struct spoe_frame *frame) event_del(&frame->process_frame_event); worker = frame->worker; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); if (frame->frag_buf) free(frame->frag_buf); memset(frame, 0, sizeof(*frame)+max_frame_size+4); - LIST_ADDQ(&worker->frames, &frame->list); + LIST_APPEND(&worker->frames, &frame->list); } static void @@ -1041,7 +1041,7 @@ release_client(struct client *c) DEBUG(c->worker, "<%lu> Release client", c->id); - LIST_DEL(&c->by_worker); + LIST_DELETE(&c->by_worker); c->worker->nbclients--; unuse_spoe_engine(c); @@ -1113,12 +1113,12 @@ use_spoe_engine(struct client *client) LIST_INIT(&eng->clients); LIST_INIT(&eng->processing_frames); LIST_INIT(&eng->outgoing_frames); - LIST_ADDQ(&client->worker->engines, &eng->list); + LIST_APPEND(&client->worker->engines, &eng->list); LOG(client->worker, "Add new SPOE engine '%s'", eng->id); end: client->engine = eng; - LIST_ADDQ(&eng->clients, &client->by_engine); + LIST_APPEND(&eng->clients, &client->by_engine); } static void @@ -1132,12 +1132,12 @@ unuse_spoe_engine(struct client *client) eng = client->engine; client->engine = NULL; - LIST_DEL(&client->by_engine); + LIST_DELETE(&client->by_engine); if (!LIST_ISEMPTY(&eng->clients)) return; LOG(client->worker, "Remove SPOE engine '%s'", eng->id); - LIST_DEL(&eng->list); + LIST_DELETE(&eng->list); list_for_each_entry_safe(frame, back, &eng->processing_frames, list) { release_frame(frame); @@ -1167,7 +1167,7 @@ acquire_incoming_frame(struct client *client) } else { frame = LIST_NEXT(&client->worker->frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); } reset_frame(frame); @@ -1195,12 +1195,12 @@ acquire_outgoing_frame(struct client *client) frame = client->outgoing_frame; else if (!LIST_ISEMPTY(&client->outgoing_frames)) { frame = LIST_NEXT(&client->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } else if (engine!= NULL && !LIST_ISEMPTY(&engine->outgoing_frames)) { frame = LIST_NEXT(&engine->outgoing_frames, typeof(frame), list); - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); client->outgoing_frame = frame; } return frame; @@ -1211,7 +1211,7 @@ write_frame(struct client *client, struct spoe_frame *frame) { uint32_t netint; - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); frame->buf = (char *)(frame->data); frame->offset = 0; @@ -1227,7 +1227,7 @@ write_frame(struct client *client, struct spoe_frame *frame) if (client->outgoing_frame == NULL) client->outgoing_frame = frame; else - LIST_ADD(&client->outgoing_frames, &frame->list); + LIST_INSERT(&client->outgoing_frames, &frame->list); } else { client->outgoing_frame = frame; @@ -1236,12 +1236,12 @@ write_frame(struct client *client, struct spoe_frame *frame) } else { /* for all other frames */ if (frame->client == NULL) { /* async mode ! */ - LIST_ADDQ(&frame->engine->outgoing_frames, &frame->list); + LIST_APPEND(&frame->engine->outgoing_frames, &frame->list); list_for_each_entry(client, &frame->engine->clients, by_engine) event_add(&client->write_frame_event, NULL); } else if (frame->client->pipelining) { - LIST_ADDQ(&frame->client->outgoing_frames, &frame->list); + LIST_APPEND(&frame->client->outgoing_frames, &frame->list); event_add(&frame->client->write_frame_event, NULL); } else { @@ -1265,10 +1265,10 @@ process_incoming_frame(struct spoe_frame *frame) if (client->async) { frame->client = NULL; - LIST_ADDQ(&frame->engine->processing_frames, &frame->list); + LIST_APPEND(&frame->engine->processing_frames, &frame->list); } else if (client->pipelining) - LIST_ADDQ(&client->processing_frames, &frame->list); + LIST_APPEND(&client->processing_frames, &frame->list); else event_del(&client->read_frame_event); } @@ -1627,7 +1627,7 @@ accept_cb(int listener, short event, void *arg) LIST_INIT(&client->processing_frames); LIST_INIT(&client->outgoing_frames); - LIST_ADDQ(&worker->clients, &client->by_worker); + LIST_APPEND(&worker->clients, &client->by_worker); worker->nbclients++; @@ -1657,7 +1657,7 @@ worker_function(void *data) } list_for_each_entry_safe(frame, fback, &worker->frames, list) { - LIST_DEL(&frame->list); + LIST_DELETE(&frame->list); free(frame); } diff --git a/doc/internals/list.fig b/doc/internals/list.fig index dc1f4dc02a..35663ffb65 100644 --- a/doc/internals/list.fig +++ b/doc/internals/list.fig @@ -1,150 +1,27 @@ -#FIG 3.2 +#FIG 3.2 Produced by xfig version 3.2.7b Landscape Center Metric -A4 -100.00 +A4 +119.50 Single -2 1200 2 -6 720 8325 1080 9135 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 990 8765 765 8765 -2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 - 765 8415 990 8415 990 9090 765 9090 765 8415 -4 1 0 50 0 14 10 0.0000 4 90 90 880 8967 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 878 8640 N\001 --6 -6 1170 8325 1530 9135 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1440 8765 1215 8765 -2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5 - 1215 8415 1440 8415 1440 9090 1215 9090 1215 8415 -4 1 0 50 0 14 10 0.0000 4 90 90 1330 8967 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 1328 8640 N\001 --6 -6 1620 8325 1980 9135 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 1890 8765 1665 8765 -2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5 - 1665 8415 1890 8415 1890 9090 1665 9090 1665 8415 -4 1 0 50 0 14 10 0.0000 4 90 90 1780 8967 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 1778 8640 N\001 --6 -6 2700 8055 3420 9225 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3150 8675 2925 8675 -2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 - 2925 8325 3150 8325 3150 9000 2925 9000 2925 8325 -3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 - 1 1 1.00 60.00 120.00 - 3150 8505 3375 8505 3375 8100 2700 8100 2700 8505 2925 8505 - 0.000 1.000 1.000 1.000 1.000 0.000 -3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 - 1 1 1.00 60.00 120.00 - 3150 8820 3375 8820 3375 9225 2700 9225 2700 8820 2925 8820 - 0.000 1.000 1.000 1.000 1.000 0.000 -4 1 0 50 0 14 10 0.0000 4 90 90 3040 8877 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 3038 8550 N\001 --6 -6 2115 8100 2655 9180 -6 2115 8100 2655 9180 -6 2295 8235 2655 9045 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2565 8675 2340 8675 -2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 - 2340 8325 2565 8325 2565 9000 2340 9000 2340 8325 -4 1 0 50 0 14 10 0.0000 4 90 90 2455 8877 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 2453 8550 N\001 --6 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2565 8325 2115 8325 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 2115 9000 2565 9000 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 2115 8100 2565 8100 2565 9180 2115 9180 2115 8100 -4 1 0 50 0 14 12 0.0000 4 120 105 2250 8730 L\001 --6 --6 -6 3420 8100 4095 9225 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 3870 8675 3645 8675 -2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 3645 8325 3870 8325 3870 9000 3645 9000 3645 8325 -3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 - 1 1 1.00 60.00 120.00 - 3870 8505 4095 8505 4095 8100 3420 8100 3420 8505 3645 8505 - 0.000 1.000 1.000 1.000 1.000 0.000 -3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 - 1 1 1.00 60.00 120.00 - 3870 8820 4095 8820 4095 9225 3420 9225 3420 8820 3645 8820 - 0.000 1.000 1.000 1.000 1.000 0.000 -4 1 0 50 0 14 10 0.0000 4 90 90 3760 8877 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 3758 8550 N\001 --6 -6 4275 8190 4725 9090 -2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 4275 8190 4725 8190 4725 9090 4275 9090 4275 8190 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 4275 8640 4725 8640 -4 1 0 50 0 16 24 0.0000 4 285 270 4500 8550 N\001 -4 1 0 50 0 16 24 0.0000 4 285 240 4500 9000 P\001 --6 -6 5175 8115 5655 8595 -2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 5190 8130 5640 8130 5640 8580 5190 8580 5190 8130 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5640 8355 5190 8355 -4 1 0 50 0 16 9 0.0000 4 90 90 5415 8490 P\001 -4 1 0 50 0 16 9 0.0000 4 90 90 5415 8310 N\001 --6 -6 4995 8655 5925 9135 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5010 8895 5910 8895 -2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 - 5010 8670 5910 8670 5910 9120 5010 9120 5010 8670 -4 1 0 50 0 14 10 0.0000 4 105 630 5460 8850 list *N\001 -4 1 0 50 0 14 10 0.0000 4 105 630 5460 9075 list *P\001 --6 -6 270 8325 630 9135 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 540 8765 315 8765 -2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 - 315 8415 540 8415 540 9090 315 9090 315 8415 -4 1 0 50 0 14 10 0.0000 4 90 90 430 8967 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 428 8640 N\001 --6 -6 4860 3420 5220 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 5130 3860 4905 3860 -2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 - 4905 3510 5130 3510 5130 4185 4905 4185 4905 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 5020 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 5018 3735 N\001 --6 -6 5850 3420 6210 4230 -2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 - 6120 3860 5895 3860 -2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5 - 5895 3510 6120 3510 6120 4185 5895 4185 5895 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 6010 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 6008 3735 N\001 --6 6 3960 3420 4320 4230 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4230 3860 4005 3860 2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 4005 3510 4230 3510 4230 4185 4005 4185 4005 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 4120 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 4118 3735 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4120 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4118 3735 N\001 -6 6 4185 5580 4545 6390 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4455 6020 4230 6020 2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5 4230 5670 4455 5670 4455 6345 4230 6345 4230 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 4345 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 4343 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4345 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4343 5895 N\001 -6 6 4905 5445 5445 6525 6 4905 5445 5445 6525 @@ -153,8 +30,8 @@ Single 5355 6020 5130 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 5130 5670 5355 5670 5355 6345 5130 6345 5130 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 5245 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 5243 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 5245 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 5243 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 5355 5670 4905 5670 @@ -162,7 +39,7 @@ Single 4905 6345 5355 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 4905 5445 5355 5445 5355 6525 4905 6525 4905 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 5040 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 5040 6075 L\001 -6 -6 6 5805 5445 6345 6525 @@ -172,8 +49,8 @@ Single 6255 6020 6030 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 6030 5670 6255 5670 6255 6345 6030 6345 6030 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 6145 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 6143 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 6145 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 6143 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 6255 5670 5805 5670 @@ -181,7 +58,7 @@ Single 5805 6345 6255 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 5805 5445 6255 5445 6255 6525 5805 6525 5805 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 5940 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 5940 6075 L\001 -6 -6 6 6705 5445 7245 6525 @@ -191,8 +68,8 @@ Single 7155 6020 6930 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 6930 5670 7155 5670 7155 6345 6930 6345 6930 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 7045 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 7043 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7045 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7043 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 7155 5670 6705 5670 @@ -200,7 +77,7 @@ Single 6705 6345 7155 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 6705 5445 7155 5445 7155 6525 6705 6525 6705 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 6840 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 6840 6075 L\001 -6 -6 6 450 5580 810 6390 @@ -208,8 +85,8 @@ Single 720 6020 495 6020 2 2 0 2 0 4 53 0 20 0.000 0 0 -1 0 0 5 495 5670 720 5670 720 6345 495 6345 495 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 610 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 608 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 610 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 608 5895 N\001 -6 6 1170 5445 1710 6525 6 1170 5445 1710 6525 @@ -218,8 +95,8 @@ Single 1620 6020 1395 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 1395 5670 1620 5670 1620 6345 1395 6345 1395 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 1510 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 1508 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 1510 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 1508 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1620 5670 1170 5670 @@ -227,7 +104,7 @@ Single 1170 6345 1620 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 1170 5445 1620 5445 1620 6525 1170 6525 1170 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 1305 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 1305 6075 L\001 -6 -6 6 2070 5445 2610 6525 @@ -237,8 +114,8 @@ Single 2520 6020 2295 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 2295 5670 2520 5670 2520 6345 2295 6345 2295 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 2410 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 2408 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2410 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2408 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2520 5670 2070 5670 @@ -246,7 +123,7 @@ Single 2070 6345 2520 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 2070 5445 2520 5445 2520 6525 2070 6525 2070 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 2205 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 2205 6075 L\001 -6 -6 6 2970 5445 3510 6525 @@ -256,8 +133,8 @@ Single 3420 6020 3195 6020 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 3195 5670 3420 5670 3420 6345 3195 6345 3195 5670 -4 1 0 50 0 14 10 0.0000 4 90 90 3310 6222 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 3308 5895 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 3310 6222 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 3308 5895 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 3420 5670 2970 5670 @@ -265,7 +142,7 @@ Single 2970 6345 3420 6345 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 2970 5445 3420 5445 3420 6525 2970 6525 2970 5445 -4 1 0 50 0 14 12 0.0000 4 120 105 3105 6075 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 3105 6075 L\001 -6 -6 6 720 3420 1080 4230 @@ -273,24 +150,24 @@ Single 990 3860 765 3860 2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 765 3510 990 3510 990 4185 765 4185 765 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 880 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 878 3735 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 880 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 878 3735 N\001 -6 6 2700 3420 3060 4230 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2970 3860 2745 3860 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 2745 3510 2970 3510 2970 4185 2745 4185 2745 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 2860 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 2858 3735 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2860 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2858 3735 N\001 -6 6 1620 3465 1935 4230 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1890 3860 1665 3860 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 1665 3510 1890 3510 1890 4185 1665 4185 1665 3510 -4 1 0 50 0 14 10 0.0000 4 90 90 1780 4062 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 1778 3735 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 1780 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 1778 3735 N\001 -6 6 10485 3330 11025 4410 6 10665 3465 11025 4275 @@ -298,8 +175,8 @@ Single 10935 3905 10710 3905 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 10710 3555 10935 3555 10935 4230 10710 4230 10710 3555 -4 1 0 50 0 14 10 0.0000 4 90 90 10825 4107 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 10823 3780 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 10825 4107 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 10823 3780 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 10935 3555 10485 3555 @@ -307,7 +184,7 @@ Single 10485 4230 10935 4230 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 10485 3330 10935 3330 10935 4410 10485 4410 10485 3330 -4 1 0 50 0 14 12 0.0000 4 120 105 10620 3960 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 10620 3960 L\001 -6 6 7110 3105 7650 4185 6 7110 3105 7650 4185 @@ -316,8 +193,8 @@ Single 7560 3680 7335 3680 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 7335 3330 7560 3330 7560 4005 7335 4005 7335 3330 -4 1 0 50 0 14 10 0.0000 4 90 90 7450 3882 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 7448 3555 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7450 3882 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7448 3555 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 7560 3330 7110 3330 @@ -325,7 +202,7 @@ Single 7110 4005 7560 4005 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 7110 3105 7560 3105 7560 4185 7110 4185 7110 3105 -4 1 0 50 0 14 12 0.0000 4 120 105 7245 3735 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 7245 3735 L\001 -6 -6 6 8010 3105 8550 4185 @@ -335,8 +212,8 @@ Single 8460 3680 8235 3680 2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 8235 3330 8460 3330 8460 4005 8235 4005 8235 3330 -4 1 0 50 0 14 10 0.0000 4 90 90 8350 3882 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 8348 3555 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 8350 3882 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 8348 3555 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 8460 3330 8010 3330 @@ -344,7 +221,7 @@ Single 8010 4005 8460 4005 2 2 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 5 8010 3105 8460 3105 8460 4185 8010 4185 8010 3105 -4 1 0 50 0 14 12 0.0000 4 120 105 8145 3735 L\001 +4 1 0 50 0 14 12 0.0000 4 120 120 8145 3735 L\001 -6 -6 6 9315 990 12195 2160 @@ -353,8 +230,8 @@ Single 9945 1520 9720 1520 2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 9720 1170 9945 1170 9945 1845 9720 1845 9720 1170 -4 1 0 50 0 14 10 0.0000 4 90 90 9835 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 9833 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 9835 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 9833 1395 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 10935 1520 10710 1520 @@ -390,50 +267,50 @@ Single 1 1 1.00 60.00 120.00 10665 1710 9945 1710 0.000 0.000 -4 1 0 50 0 14 10 0.0000 4 90 90 10825 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 10823 1395 N\001 -4 1 0 50 0 14 10 0.0000 4 90 90 11815 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 11813 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 10825 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 10823 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 11815 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 11813 1395 N\001 -6 6 6345 1080 6705 1890 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 6615 1520 6390 1520 2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 6390 1170 6615 1170 6615 1845 6390 1845 6390 1170 -4 1 0 50 0 14 10 0.0000 4 90 90 6505 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 6503 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 6505 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 6503 1395 N\001 -6 6 7335 1080 7695 1890 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 7605 1520 7380 1520 2 2 0 2 0 6 52 0 20 0.000 0 0 -1 0 0 5 7380 1170 7605 1170 7605 1845 7380 1845 7380 1170 -4 1 0 50 0 14 10 0.0000 4 90 90 7495 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 7493 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7495 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 7493 1395 N\001 -6 6 8325 1080 8685 1890 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 8595 1520 8370 1520 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 8370 1170 8595 1170 8595 1845 8370 1845 8370 1170 -4 1 0 50 0 14 10 0.0000 4 90 90 8485 1722 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 8483 1395 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 8485 1722 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 8483 1395 N\001 -6 6 3870 1215 4185 1980 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4140 1610 3915 1610 2 2 0 2 0 2 53 0 20 0.000 0 0 -1 0 0 5 3915 1260 4140 1260 4140 1935 3915 1935 3915 1260 -4 1 0 50 0 14 10 0.0000 4 90 90 4030 1812 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 4028 1485 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4030 1812 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4028 1485 N\001 -6 6 4770 1215 5085 1980 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 5040 1610 4815 1610 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 4815 1260 5040 1260 5040 1935 4815 1935 4815 1260 -4 1 0 50 0 14 10 0.0000 4 90 90 4930 1812 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 4928 1485 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4930 1812 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4928 1485 N\001 -6 6 2205 990 2925 2160 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 @@ -448,23 +325,43 @@ Single 1 1 1.00 60.00 120.00 2655 1755 2880 1755 2880 2160 2205 2160 2205 1755 2430 1755 0.000 1.000 1.000 1.000 1.000 0.000 -4 1 0 50 0 14 10 0.0000 4 90 90 2545 1812 P\001 -4 1 0 50 0 14 10 0.0000 4 90 90 2543 1485 N\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2545 1812 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 2543 1485 N\001 -6 6 525 1350 1455 1830 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 540 1590 1440 1590 2 2 0 2 0 7 50 0 -1 0.000 0 0 -1 0 0 5 540 1365 1440 1365 1440 1815 540 1815 540 1365 -4 1 0 50 0 14 10 0.0000 4 105 630 990 1545 list *N\001 -4 1 0 50 0 14 10 0.0000 4 105 630 990 1770 list *P\001 +4 1 0 50 0 14 10 0.0000 4 105 735 990 1545 list *N\001 +4 1 0 50 0 14 10 0.0000 4 105 735 990 1770 list *P\001 +-6 +6 4815 3420 5175 4230 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 5085 3860 4860 3860 +2 2 0 2 0 7 53 0 20 0.000 0 0 -1 0 0 5 + 4860 3510 5085 3510 5085 4185 4860 4185 4860 3510 +4 1 0 50 0 14 10 0.0000 4 105 105 4975 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 4973 3735 N\001 +-6 +6 5715 3285 6390 4410 +2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 + 6165 3860 5940 3860 +2 2 0 2 0 6 53 0 20 0.000 0 0 -1 0 0 5 + 5940 3510 6165 3510 6165 4185 5940 4185 5940 3510 +3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 + 1 1 1.00 60.00 120.00 + 6165 3690 6390 3690 6390 3285 5715 3285 5715 3690 5940 3690 + 0.000 1.000 1.000 1.000 1.000 0.000 +3 0 0 1 0 7 50 0 -1 0.000 0 1 0 6 + 1 1 1.00 60.00 120.00 + 6165 4005 6390 4005 6390 4410 5715 4410 5715 4005 5940 4005 + 0.000 1.000 1.000 1.000 1.000 0.000 +4 1 0 50 0 14 10 0.0000 4 105 105 6055 4062 P\001 +4 1 0 50 0 14 10 0.0000 4 105 105 6053 3735 N\001 -6 -2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 - 3330 2475 6435 2475 6435 4500 3330 4500 3330 2475 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 4050 4725 7605 4725 7605 6840 4050 6840 4050 4725 -2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 - 12600 6840 12600 4725 7785 4725 7785 6840 12600 6840 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 315 4725 3870 4725 3870 6840 315 6840 315 4725 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 @@ -489,6 +386,10 @@ Single 1845 270 3240 270 3240 2250 1845 2250 1845 270 2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 315 270 1620 270 1620 2250 315 2250 315 270 +2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 + 3330 2475 6435 2475 6435 4500 3330 4500 3330 2475 +2 4 0 1 0 7 50 0 -1 0.000 0 0 7 0 0 5 + 12285 6840 12285 4725 7785 4725 7785 6840 12285 6840 3 0 0 1 0 7 50 0 -1 0.000 0 1 0 2 1 1 1.00 60.00 120.00 4230 3690 4860 3690 @@ -497,11 +398,6 @@ Single 1 1 1.00 60.00 120.00 4860 4050 4230 4050 0.000 0.000 -3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7 - 1 1 1.00 60.00 120.00 - 5130 3690 5580 3690 5580 3240 3600 3240 3600 3690 3780 3690 - 3960 3690 - 0.000 1.000 1.000 1.000 1.000 1.000 0.000 3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7 1 1 1.00 60.00 120.00 3960 4050 3780 4050 3600 4050 3600 4410 5580 4410 5580 4050 @@ -655,44 +551,49 @@ Single 3870 1800 3690 1800 3510 1800 3510 2160 5490 2160 5490 1800 5040 1800 0.000 1.000 1.000 1.000 1.000 1.000 0.000 -4 1 0 50 0 14 10 0.0000 4 135 3240 5805 4950 Asymmetrical list starting at R(red)\001 -4 0 0 50 0 12 10 0.0000 4 135 3780 7875 5715 - FOREACH_ITEM(it, R, end, struct foo*, L)\001 -4 0 0 50 0 12 10 0.0000 4 105 2610 7875 5490 - last element has R->P == &L\001 -4 1 0 50 0 14 10 0.0000 4 135 3510 10215 4950 Symmetrical lists vs Asymmetrical lists\001 -4 0 0 50 0 12 10 0.0000 4 135 4680 7875 6165 - FOREACH_ITEM_SAFE(it, bck, R, end, struct foo*, L)\001 -4 0 0 50 0 12 10 0.0000 4 135 4500 7875 6390 does the same except that allows to delete\001 -4 0 0 50 0 12 10 0.0000 4 135 2340 7875 6570 any node, including \001 -4 1 0 50 0 12 10 0.0000 4 135 450 5130 5355 foo_0\001 -4 1 0 50 0 12 10 0.0000 4 135 450 6030 5355 foo_1\001 -4 1 0 50 0 12 10 0.0000 4 135 450 6930 5355 foo_2\001 -4 1 0 50 0 14 10 0.0000 4 135 3150 2070 4950 Symmetrical list starting at R(red)\001 -4 1 0 50 0 12 10 0.0000 4 135 450 3195 5355 foo_2\001 -4 1 0 50 0 12 10 0.0000 4 135 450 2295 5355 foo_1\001 -4 1 0 50 0 12 10 0.0000 4 135 450 1395 5355 foo_0\001 -4 1 0 50 0 12 10 0.0000 4 105 270 9855 3420 foo\001 -4 1 0 50 0 12 10 0.0000 4 90 90 9990 3825 E\001 -4 1 0 50 0 12 10 0.0000 4 135 2520 4905 3015 Replaces W with Y, returns W\001 -4 1 0 50 0 14 10 0.0000 4 135 1440 7785 2655 Linking elements\001 -4 1 0 50 0 12 10 0.0000 4 135 450 8235 3015 foo_1\001 -4 1 0 50 0 12 10 0.0000 4 135 450 7335 3015 foo_0\001 -4 1 0 50 0 12 10 0.0000 4 135 3060 7425 810 adds Y(yellow) just after G(green)\001 -4 1 0 50 0 12 10 0.0000 4 135 1170 4500 855 adds W(white)\001 -4 1 0 50 0 12 10 0.0000 4 135 2700 10755 810 adds Y at the queue (before G)\001 -4 1 0 50 0 12 12 0.0000 4 165 630 990 1080 P=prev\001 -4 1 0 50 0 14 12 0.0000 4 135 1155 945 585 struct list\001 -4 1 0 50 0 12 12 0.0000 4 120 630 990 855 N=next\001 -4 1 0 50 0 12 10 0.0000 4 105 1080 2565 900 Terminates G\001 -4 1 0 50 0 14 10 0.0000 4 105 1260 2565 675 struct list *G\001 -4 1 0 50 0 14 10 0.0000 4 135 1260 2565 495 LIST_INIT(G):G\001 -4 1 0 50 0 14 10 0.0000 4 135 1350 4500 495 LIST_ADD(G,W):W\001 -4 1 0 50 0 14 10 0.0000 4 135 1440 4500 675 LIST_ADDQ(G,W):W\001 -4 1 0 50 0 14 10 0.0000 4 135 1350 7425 540 LIST_ADD(G,Y):Y\001 -4 1 0 50 0 14 10 0.0000 4 135 1440 10755 540 LIST_ADDQ(G,Y):Y\001 -4 1 0 50 0 12 10 0.0000 4 135 2610 1755 3060 unlinks and returns Y(yellow)\001 -4 1 0 50 0 14 10 0.0000 4 135 1170 1755 2790 LIST_DEL(Y):Y\001 -4 1 0 50 0 14 10 0.0000 4 135 1440 4905 2745 LIST_RIWI(W,Y):W\001 -4 1 0 50 0 12 10 0.0000 4 135 2790 10665 3105 containing header E as member L\001 -4 1 0 50 0 14 10 0.0000 4 135 2880 10665 2700 foo=LIST_ELEM(E, struct foo*, L)\001 -4 1 0 50 0 12 10 0.0000 4 135 2880 10665 2925 Returns a pointer to struct foo*\001 -4 0 0 50 0 12 10 0.0000 4 135 2610 7875 5265 - both are empty if R->P == R\001 -4 0 0 50 0 12 10 0.0000 4 135 3960 7875 5940 iterates through foo{0,1,2} and stops\001 +3 0 0 1 0 7 50 0 -1 0.000 0 1 0 7 + 1 1 1.00 60.00 120.00 + 5130 3690 5580 3690 5580 3240 3600 3240 3600 3690 3780 3690 + 3960 3690 + 0.000 1.000 1.000 1.000 1.000 1.000 0.000 +4 1 0 50 0 14 10 0.0000 4 135 3780 5805 4950 Asymmetrical list starting at R(red)\001 +4 1 0 50 0 14 10 0.0000 4 135 4095 10215 4950 Symmetrical lists vs Asymmetrical lists\001 +4 1 0 50 0 12 10 0.0000 4 135 525 5130 5355 foo_0\001 +4 1 0 50 0 12 10 0.0000 4 135 525 6030 5355 foo_1\001 +4 1 0 50 0 12 10 0.0000 4 135 525 6930 5355 foo_2\001 +4 1 0 50 0 14 10 0.0000 4 135 3675 2070 4950 Symmetrical list starting at R(red)\001 +4 1 0 50 0 12 10 0.0000 4 135 525 3195 5355 foo_2\001 +4 1 0 50 0 12 10 0.0000 4 135 525 2295 5355 foo_1\001 +4 1 0 50 0 12 10 0.0000 4 135 525 1395 5355 foo_0\001 +4 1 0 50 0 12 10 0.0000 4 105 315 9855 3420 foo\001 +4 1 0 50 0 12 10 0.0000 4 105 105 9990 3825 E\001 +4 1 0 50 0 14 10 0.0000 4 135 1680 7785 2655 Linking elements\001 +4 1 0 50 0 12 10 0.0000 4 135 525 8235 3015 foo_1\001 +4 1 0 50 0 12 10 0.0000 4 135 525 7335 3015 foo_0\001 +4 1 0 50 0 14 10 0.0000 4 105 1470 2565 675 struct list *G\001 +4 1 0 50 0 14 10 0.0000 4 135 1470 2565 495 LIST_INIT(G):G\001 +4 1 0 50 0 14 10 0.0000 4 135 1890 4500 495 LIST_INSERT(G,W):W\001 +4 1 0 50 0 14 10 0.0000 4 135 3360 10665 2700 foo=LIST_ELEM(E, struct foo*, L)\001 +4 1 0 50 0 14 10 0.0000 4 135 1890 4500 675 LIST_APPEND(G,W):W\001 +4 1 0 50 0 14 10 0.0000 4 135 1890 7425 540 LIST_INSERT(G,Y):Y\001 +4 1 0 50 0 14 10 0.0000 4 135 1890 10755 540 LIST_APPEND(G,Y):Y\001 +4 1 0 50 0 14 10 0.0000 4 135 1680 1755 2790 LIST_DELETE(Y):Y\001 +4 1 0 50 0 14 10 0.0000 4 135 1890 4905 2745 LIST_DEL_INIT(Y):Y\001 +4 1 0 50 0 12 9 0.0000 4 120 2880 10665 2925 Returns a pointer to struct foo*\001 +4 1 0 50 0 12 9 0.0000 4 120 2790 10665 3105 containing header E as member L\001 +4 1 0 50 0 12 9 0.0000 4 120 2700 10755 810 adds Y at the queue (before G)\001 +4 1 0 50 0 12 9 0.0000 4 120 3060 7425 810 adds Y(yellow) just after G(green)\001 +4 1 0 50 0 12 9 0.0000 4 120 1170 4500 855 adds W(white)\001 +4 1 0 50 0 12 9 0.0000 4 105 1080 2565 900 Terminates G\001 +4 1 0 50 0 12 9 0.0000 4 90 540 990 855 N=next\001 +4 1 0 50 0 12 9 0.0000 4 105 540 990 1080 P=prev\001 +4 1 0 50 0 12 9 0.0000 4 120 2610 1755 3060 unlinks and returns Y(yellow)\001 +4 1 0 50 0 12 9 0.0000 4 120 2610 4905 3060 unlinks, inits, and returns Y\001 +4 0 0 50 0 12 8 0.0000 4 105 2175 7875 5265 - both are empty if R->P == R\001 +4 0 0 50 0 12 8 0.0000 4 90 2175 7875 5490 - last element has R->P == &L\001 +4 0 0 50 0 12 8 0.0000 4 105 3150 7875 5715 - FOREACH_ITEM(it, R, end, struct foo*, L)\001 +4 0 0 50 0 12 8 0.0000 4 105 3300 7875 5940 iterates through foo{0,1,2} and stops\001 +4 0 0 50 0 12 8 0.0000 4 105 3900 7875 6165 - FOREACH_ITEM_SAFE(it, bck, R, end, struct foo*, L)\001 +4 0 0 50 0 12 8 0.0000 4 105 3750 7875 6390 does the same except that allows to delete\001 +4 0 0 50 0 12 8 0.0000 4 105 1950 7875 6570 any node, including \001 +4 1 0 50 0 14 11 0.0000 4 135 1155 945 585 struct list\001 diff --git a/doc/internals/list.png b/doc/internals/list.png new file mode 100644 index 0000000000..ec41a6bf6f Binary files /dev/null and b/doc/internals/list.png differ diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 48b5166880..b39b9c406e 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -87,7 +87,7 @@ static inline struct appctx *appctx_new(struct applet *applet, unsigned long thr static inline void __appctx_free(struct appctx *appctx) { task_destroy(appctx->t); - if (LIST_ADDED(&appctx->buffer_wait.list)) + if (LIST_INLIST(&appctx->buffer_wait.list)) LIST_DEL_INIT(&appctx->buffer_wait.list); pool_free(pool_head_appctx, appctx); diff --git a/include/haproxy/channel.h b/include/haproxy/channel.h index d37eec461e..65c294fe14 100644 --- a/include/haproxy/channel.h +++ b/include/haproxy/channel.h @@ -843,8 +843,8 @@ static inline int channel_alloc_buffer(struct channel *chn, struct buffer_wait * if (b_alloc(&chn->buf) != NULL) return 1; - if (!LIST_ADDED(&wait->list)) - LIST_ADDQ(&ti->buffer_wq, &wait->list); + if (!LIST_INLIST(&wait->list)) + LIST_APPEND(&ti->buffer_wq, &wait->list); return 0; } diff --git a/include/haproxy/connection.h b/include/haproxy/connection.h index 7011193c22..ae5f636c61 100644 --- a/include/haproxy/connection.h +++ b/include/haproxy/connection.h @@ -545,7 +545,7 @@ static inline void conn_free(struct connection *conn) { /* If the connection is owned by the session, remove it from its list */ - if (LIST_ADDED(&conn->session_list)) { + if (LIST_INLIST(&conn->session_list)) { session_unown_conn(conn->owner, conn); } else if (!(conn->flags & CO_FL_PRIVATE)) { @@ -559,7 +559,7 @@ static inline void conn_free(struct connection *conn) * already scheduled from cleaning but is freed before via another * call. */ - MT_LIST_DEL(&conn->toremove_list); + MT_LIST_DELETE(&conn->toremove_list); sockaddr_free(&conn->src); sockaddr_free(&conn->dst); @@ -904,13 +904,13 @@ static inline int conn_get_alpn(const struct connection *conn, const char **str, /* registers proto mux list . Modifies the list element! */ static inline void register_mux_proto(struct mux_proto_list *list) { - LIST_ADDQ(&mux_proto_list.list, &list->list); + LIST_APPEND(&mux_proto_list.list, &list->list); } /* unregisters proto mux list */ static inline void unregister_mux_proto(struct mux_proto_list *list) { - LIST_DEL(&list->list); + LIST_DELETE(&list->list); LIST_INIT(&list->list); } diff --git a/include/haproxy/http_rules.h b/include/haproxy/http_rules.h index 159abb8556..060e3e80fb 100644 --- a/include/haproxy/http_rules.h +++ b/include/haproxy/http_rules.h @@ -39,17 +39,17 @@ struct redirect_rule *http_parse_redirect_rule(const char *file, int linenum, st static inline void http_req_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&http_req_keywords.list, &kw_list->list); + LIST_APPEND(&http_req_keywords.list, &kw_list->list); } static inline void http_res_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&http_res_keywords.list, &kw_list->list); + LIST_APPEND(&http_res_keywords.list, &kw_list->list); } static inline void http_after_res_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&http_after_res_keywords.list, &kw_list->list); + LIST_APPEND(&http_after_res_keywords.list, &kw_list->list); } struct action_kw *action_http_req_custom(const char *kw); diff --git a/include/haproxy/list.h b/include/haproxy/list.h index c46cc30121..1d39a9d718 100644 --- a/include/haproxy/list.h +++ b/include/haproxy/list.h @@ -45,10 +45,10 @@ #define LIST_HEAD_INIT(l) { &l, &l } /* adds an element at the beginning of a list ; returns the element */ -#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) +#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); (el); }) /* adds an element at the end of a list ; returns the element */ -#define LIST_ADDQ(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) +#define LIST_APPEND(lh, el) ({ (el)->p = (lh)->p; (el)->p->n = (lh)->p = (el); (el)->n = (lh); (el); }) /* adds the contents of a list at the beginning of another list . The old list head remains untouched. */ #define LIST_SPLICE(new, old) do { \ @@ -72,10 +72,10 @@ } while (0) /* removes an element from a list and returns it */ -#define LIST_DEL(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) +#define LIST_DELETE(el) ({ typeof(el) __ret = (el); (el)->n->p = (el)->p; (el)->p->n = (el)->n; (__ret); }) /* removes an element from a list, initializes it and returns it. - * This is faster than LIST_DEL+LIST_INIT as we avoid reloading the pointers. + * This is faster than LIST_DELETE+LIST_INIT as we avoid reloading the pointers. */ #define LIST_DEL_INIT(el) ({ \ typeof(el) __ret = (el); \ @@ -99,7 +99,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define LIST_ADDED(el) ((el)->n != (el)) +#define LIST_INLIST(el) ((el)->n != (el)) /* returns a pointer of type to a structure following the element * which contains list head , which is known as element in @@ -225,7 +225,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADD(_lh, _el) \ +#define MT_LIST_TRY_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -284,7 +284,7 @@ * Returns 1 if we added the item, 0 otherwise (because it was already in a * list). */ -#define MT_LIST_TRY_ADDQ(_lh, _el) \ +#define MT_LIST_TRY_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -342,7 +342,7 @@ * Add an item at the beginning of a list. * It is assumed the element can't already be in a list, so it isn't checked. */ -#define MT_LIST_ADD(_lh, _el) \ +#define MT_LIST_INSERT(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -375,7 +375,7 @@ * Add an item at the end of a list. * It is assumed the element can't already be in a list, so it isn't checked */ -#define MT_LIST_ADDQ(_lh, _el) \ +#define MT_LIST_APPEND(_lh, _el) \ ({ \ int _ret = 0; \ struct mt_list *lh = (_lh), *el = (_el); \ @@ -407,8 +407,8 @@ /* * Detach a list from its head. A pointer to the first element is returned * and the list is closed. If the list was empty, NULL is returned. This may - * exclusively be used with lists modified by MT_LIST_TRY_ADD/MT_LIST_TRY_ADDQ. This - * is incompatible with MT_LIST_DEL run concurrently. + * exclusively be used with lists modified by MT_LIST_TRY_INSERT/MT_LIST_TRY_APPEND. This + * is incompatible with MT_LIST_DELETE run concurrently. * If there's at least one element, the next of the last element will always * be NULL. */ @@ -455,7 +455,7 @@ /* Remove an item from a list. * Returns 1 if we removed the item, 0 otherwise (because it was in no list). */ -#define MT_LIST_DEL(_el) \ +#define MT_LIST_DELETE(_el) \ ({ \ int _ret = 0; \ struct mt_list *el = (_el); \ @@ -590,7 +590,7 @@ /* checks if the list element was added to a list or not. This only * works when detached elements are reinitialized (using LIST_DEL_INIT) */ -#define MT_LIST_ADDED(el) ((el)->next != (el)) +#define MT_LIST_INLIST(el) ((el)->next != (el)) /* Lock an element in the list, to be sure it won't be removed. * It needs to be synchronized somehow to be sure it's not removed @@ -723,10 +723,10 @@ p->next = n; \ } while (0); -/* Equivalent of MT_LIST_DEL(), to be used when parsing the list with mt_list_entry_for_each_safe(). +/* Equivalent of MT_LIST_DELETE(), to be used when parsing the list with mt_list_entry_for_each_safe(). * It should be the element currently parsed (tmpelt1) */ -#define MT_LIST_DEL_SAFE(_el) \ +#define MT_LIST_DELETE_SAFE(_el) \ do { \ struct mt_list *el = (_el); \ (el)->prev = (el); \ @@ -734,8 +734,8 @@ (_el) = NULL; \ } while (0) -/* Safe as MT_LIST_DEL_SAFE, but it won't reinit the element */ -#define MT_LIST_DEL_SAFE_NOINIT(_el) \ +/* Safe as MT_LIST_DELETE_SAFE, but it won't reinit the element */ +#define MT_LIST_DELETE_SAFE_NOINIT(_el) \ do { \ (_el) = NULL; \ } while (0) @@ -746,10 +746,10 @@ * the list is passed in . A temporary variable of same type * as is needed so that may safely be deleted if needed. * tmpelt1 is a temporary struct mt_list *, and tmpelt2 is a temporary - * struct mt_list, used internally, both are needed for MT_LIST_DEL_SAFE. + * struct mt_list, used internally, both are needed for MT_LIST_DELETE_SAFE. * Example: list_for_each_entry_safe(cur_acl, tmp, known_acl, list, elt1, elt2) * { ... }; - * If you want to remove the current element, please use MT_LIST_DEL_SAFE. + * If you want to remove the current element, please use MT_LIST_DELETE_SAFE. */ #define mt_list_for_each_entry_safe(item, list_head, member, tmpelt, tmpelt2) \ for ((tmpelt) = NULL; (tmpelt) != MT_LIST_BUSY; ({ \ diff --git a/include/haproxy/listener.h b/include/haproxy/listener.h index a8c798c53a..3fb078f8cb 100644 --- a/include/haproxy/listener.h +++ b/include/haproxy/listener.h @@ -194,7 +194,7 @@ static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *fi goto err; } - LIST_ADDQ(&fe->conf.bind, &bind_conf->by_fe); + LIST_APPEND(&fe->conf.bind, &bind_conf->by_fe); bind_conf->settings.ux.uid = -1; bind_conf->settings.ux.gid = -1; bind_conf->settings.ux.mode = 0; diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h index a7d77e4c6b..4d13d4c2f8 100644 --- a/include/haproxy/pool.h +++ b/include/haproxy/pool.h @@ -241,8 +241,8 @@ static inline void *pool_get_from_cache(struct pool_head *pool) ph->count--; pool_cache_bytes -= pool->size; pool_cache_count--; - LIST_DEL(&item->by_pool); - LIST_DEL(&item->by_lru); + LIST_DELETE(&item->by_pool); + LIST_DELETE(&item->by_lru); #ifdef DEBUG_MEMORY_POOLS /* keep track of where the element was allocated from */ *POOL_LINK(pool, item) = (void *)pool; diff --git a/include/haproxy/session.h b/include/haproxy/session.h index c5cfd5bab0..6b289e2b79 100644 --- a/include/haproxy/session.h +++ b/include/haproxy/session.h @@ -123,7 +123,7 @@ static inline void session_unown_conn(struct session *sess, struct connection *c * conn->owner that points to a dead session, but in this case the * element is not linked. */ - if (!LIST_ADDED(&conn->session_list)) + if (!LIST_INLIST(&conn->session_list)) return; if (conn->flags & CO_FL_SESS_IDLE) @@ -133,7 +133,7 @@ static inline void session_unown_conn(struct session *sess, struct connection *c list_for_each_entry(srv_list, &sess->srv_list, srv_list) { if (srv_list->target == conn->target) { if (LIST_ISEMPTY(&srv_list->conn_list)) { - LIST_DEL(&srv_list->srv_list); + LIST_DELETE(&srv_list->srv_list); pool_free(pool_head_sess_srv_list, srv_list); } break; @@ -168,9 +168,9 @@ static inline int session_add_conn(struct session *sess, struct connection *conn return 0; srv_list->target = target; LIST_INIT(&srv_list->conn_list); - LIST_ADDQ(&sess->srv_list, &srv_list->srv_list); + LIST_APPEND(&sess->srv_list, &srv_list->srv_list); } - LIST_ADDQ(&srv_list->conn_list, &conn->session_list); + LIST_APPEND(&srv_list->conn_list, &conn->session_list); return 1; } diff --git a/include/haproxy/shctx.h b/include/haproxy/shctx.h index b258f3ce01..050dbc3abf 100644 --- a/include/haproxy/shctx.h +++ b/include/haproxy/shctx.h @@ -194,24 +194,24 @@ static inline void shctx_block_append_hot(struct shared_context *shctx, struct shared_block *s) { shctx->nbav--; - LIST_DEL(&s->list); - LIST_ADD(head, &s->list); + LIST_DELETE(&s->list); + LIST_INSERT(head, &s->list); } static inline void shctx_block_set_hot(struct shared_context *shctx, struct shared_block *s) { shctx->nbav--; - LIST_DEL(&s->list); - LIST_ADDQ(&shctx->hot, &s->list); + LIST_DELETE(&s->list); + LIST_APPEND(&shctx->hot, &s->list); } static inline void shctx_block_set_avail(struct shared_context *shctx, struct shared_block *s) { shctx->nbav++; - LIST_DEL(&s->list); - LIST_ADDQ(&shctx->avail, &s->list); + LIST_DELETE(&s->list); + LIST_APPEND(&shctx->avail, &s->list); } #endif /* __HAPROXY_SHCTX_H */ diff --git a/include/haproxy/stream.h b/include/haproxy/stream.h index 9fae141b24..9a7ffa1d2d 100644 --- a/include/haproxy/stream.h +++ b/include/haproxy/stream.h @@ -284,12 +284,12 @@ static inline void stream_inc_http_fail_ctr(struct stream *s) static inline void stream_add_srv_conn(struct stream *strm, struct server *srv) { /* note: this inserts in reverse order but we do not care, it's only - * used for massive kills (i.e. almost never). MT_LIST_ADD() is a bit - * faster than MT_LIST_ADDQ under contention due to a faster recovery - * from a conflict with an adjacent MT_LIST_DEL, and using it improves + * used for massive kills (i.e. almost never). MT_LIST_INSERT() is a bit + * faster than MT_LIST_APPEND under contention due to a faster recovery + * from a conflict with an adjacent MT_LIST_DELETE, and using it improves * the performance by about 3% on 32-cores. */ - MT_LIST_ADD(&srv->per_thr[tid].streams, &strm->by_srv); + MT_LIST_INSERT(&srv->per_thr[tid].streams, &strm->by_srv); HA_ATOMIC_STORE(&strm->srv_conn, srv); } @@ -300,7 +300,7 @@ static inline void stream_del_srv_conn(struct stream *strm) if (!srv) return; - MT_LIST_DEL(&strm->by_srv); + MT_LIST_DELETE(&strm->by_srv); HA_ATOMIC_STORE(&strm->srv_conn, NULL); } diff --git a/include/haproxy/task.h b/include/haproxy/task.h index 56e7e5c242..336dad4203 100644 --- a/include/haproxy/task.h +++ b/include/haproxy/task.h @@ -397,13 +397,13 @@ static inline void _tasklet_wakeup_on(struct tasklet *tl, int thr, const char *f /* Try to remove a tasklet from the list. This call is inherently racy and may * only be performed on the thread that was supposed to dequeue this tasklet. - * This way it is safe to call MT_LIST_DEL without first removing the + * This way it is safe to call MT_LIST_DELETE without first removing the * TASK_IN_LIST bit, which must absolutely be removed afterwards in case * another thread would want to wake this tasklet up in parallel. */ static inline void tasklet_remove_from_tasklet_list(struct tasklet *t) { - if (MT_LIST_DEL((struct mt_list *)&t->list)) { + if (MT_LIST_DELETE((struct mt_list *)&t->list)) { _HA_ATOMIC_AND(&t->state, ~TASK_IN_LIST); _HA_ATOMIC_DEC(&task_per_thread[t->tid >= 0 ? t->tid : tid].rq_total); } @@ -531,7 +531,7 @@ static inline void task_destroy(struct task *t) /* Should only be called by the thread responsible for the tasklet */ static inline void tasklet_free(struct tasklet *tl) { - if (MT_LIST_DEL((struct mt_list *)&tl->list)) + if (MT_LIST_DELETE((struct mt_list *)&tl->list)) _HA_ATOMIC_DEC(&task_per_thread[tl->tid >= 0 ? tl->tid : tid].rq_total); #ifdef DEBUG_TASK @@ -595,8 +595,8 @@ static inline struct notification *notification_new(struct list *purge, struct l struct notification *com = pool_alloc(pool_head_notification); if (!com) return NULL; - LIST_ADDQ(purge, &com->purge_me); - LIST_ADDQ(event, &com->wake_me); + LIST_APPEND(purge, &com->purge_me); + LIST_APPEND(event, &com->wake_me); HA_SPIN_INIT(&com->lock); com->task = wakeup; return com; @@ -616,7 +616,7 @@ static inline void notification_purge(struct list *purge) /* Delete all pending communication signals. */ list_for_each_entry_safe(com, back, purge, purge_me) { HA_SPIN_LOCK(NOTIF_LOCK, &com->lock); - LIST_DEL(&com->purge_me); + LIST_DELETE(&com->purge_me); if (!com->task) { HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock); pool_free(pool_head_notification, com); @@ -642,7 +642,7 @@ static inline void notification_gc(struct list *purge) list_for_each_entry_safe (com, back, purge, purge_me) { if (com->task) continue; - LIST_DEL(&com->purge_me); + LIST_DELETE(&com->purge_me); pool_free(pool_head_notification, com); } } @@ -660,7 +660,7 @@ static inline void notification_wake(struct list *wake) /* Wake task and delete all pending communication signals. */ list_for_each_entry_safe(com, back, wake, wake_me) { HA_SPIN_LOCK(NOTIF_LOCK, &com->lock); - LIST_DEL(&com->wake_me); + LIST_DELETE(&com->wake_me); if (!com->task) { HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock); pool_free(pool_head_notification, com); @@ -682,7 +682,7 @@ static inline int notification_registered(struct list *wake) /* adds list item to work list and wake up the associated task */ static inline void work_list_add(struct work_list *work, struct mt_list *item) { - MT_LIST_TRY_ADDQ(&work->head, item); + MT_LIST_TRY_APPEND(&work->head, item); task_wakeup(work->task, TASK_WOKEN_OTHER); } diff --git a/include/haproxy/tcpcheck.h b/include/haproxy/tcpcheck.h index 4e92b8865f..0d92983c42 100644 --- a/include/haproxy/tcpcheck.h +++ b/include/haproxy/tcpcheck.h @@ -116,7 +116,7 @@ static inline void action_kw_tcp_check_build_list(struct buffer *chk) static inline void tcp_check_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&tcp_check_keywords.list, &kw_list->list); + LIST_APPEND(&tcp_check_keywords.list, &kw_list->list); } #endif /* _HAPROXY_TCPCHECK_H */ diff --git a/include/haproxy/trace.h b/include/haproxy/trace.h index e8d362d3e3..50857a0716 100644 --- a/include/haproxy/trace.h +++ b/include/haproxy/trace.h @@ -156,7 +156,7 @@ static inline void trace_register_source(struct trace_source *source) source->sink = NULL; source->state = TRACE_STATE_STOPPED; source->lockon_ptr = NULL; - LIST_ADDQ(&trace_sources, &source->source_link); + LIST_APPEND(&trace_sources, &source->source_link); } #endif /* _HAPROXY_TRACE_H */ diff --git a/include/haproxy/xprt_quic.h b/include/haproxy/xprt_quic.h index ca49097f44..423419e289 100644 --- a/include/haproxy/xprt_quic.h +++ b/include/haproxy/xprt_quic.h @@ -1016,7 +1016,7 @@ static inline void quic_pktns_discard(struct quic_pktns *pktns, pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node); node = eb64_next(node); list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) { - LIST_DEL(&frm->list); + LIST_DELETE(&frm->list); pool_free(pool_head_quic_tx_frm, frm); } eb64_delete(&pkt->pn_node); @@ -1188,14 +1188,14 @@ static inline void quic_rx_packet_refdec(struct quic_rx_packet *pkt) static inline void quic_rx_packet_list_addq(struct list *list, struct quic_rx_packet *pkt) { - LIST_ADDQ(list, &pkt->list); + LIST_APPEND(list, &pkt->list); quic_rx_packet_refinc(pkt); } /* Remove RX packet from , decrementing its reference counter. */ static inline void quic_rx_packet_list_del(struct quic_rx_packet *pkt) { - LIST_DEL(&pkt->list); + LIST_DELETE(&pkt->list); quic_rx_packet_refdec(pkt); } diff --git a/src/acl.c b/src/acl.c index 655f9f40f1..193788c506 100644 --- a/src/acl.c +++ b/src/acl.c @@ -49,7 +49,7 @@ static inline enum acl_test_res pat2acl(struct pattern *pat) */ void acl_register_keywords(struct acl_kw_list *kwl) { - LIST_ADDQ(&acl_keywords.list, &kwl->list); + LIST_APPEND(&acl_keywords.list, &kwl->list); } /* @@ -57,7 +57,7 @@ void acl_register_keywords(struct acl_kw_list *kwl) */ void acl_unregister_keywords(struct acl_kw_list *kwl) { - LIST_DEL(&kwl->list); + LIST_DELETE(&kwl->list); LIST_INIT(&kwl->list); } @@ -278,7 +278,7 @@ struct acl_expr *parse_acl_expr(const char **args, char **err, struct arg_list * if (!conv_expr) goto out_free_smp; - LIST_ADDQ(&(smp->conv_exprs), &(conv_expr->list)); + LIST_APPEND(&(smp->conv_exprs), &(conv_expr->list)); conv_expr->conv = conv; acl_conv_found = 1; @@ -653,7 +653,7 @@ struct acl *prune_acl(struct acl *acl) { free(acl->name); list_for_each_entry_safe(expr, exprb, &acl->expr, list) { - LIST_DEL(&expr->list); + LIST_DELETE(&expr->list); prune_acl_expr(expr); free(expr); } @@ -721,7 +721,7 @@ struct acl *parse_acl(const char **args, struct list *known_acl, char **err, str } LIST_INIT(&cur_acl->expr); - LIST_ADDQ(known_acl, &cur_acl->list); + LIST_APPEND(known_acl, &cur_acl->list); cur_acl->name = name; } @@ -731,7 +731,7 @@ struct acl *parse_acl(const char **args, struct list *known_acl, char **err, str */ cur_acl->use |= acl_expr->smp->fetch->use; cur_acl->val |= acl_expr->smp->fetch->val; - LIST_ADDQ(&cur_acl->expr, &acl_expr->list); + LIST_APPEND(&cur_acl->expr, &acl_expr->list); return cur_acl; out_free_name: @@ -824,9 +824,9 @@ static struct acl *find_acl_default(const char *acl_name, struct list *known_acl cur_acl->use |= acl_expr->smp->fetch->use; cur_acl->val |= acl_expr->smp->fetch->val; LIST_INIT(&cur_acl->expr); - LIST_ADDQ(&cur_acl->expr, &acl_expr->list); + LIST_APPEND(&cur_acl->expr, &acl_expr->list); if (known_acl) - LIST_ADDQ(known_acl, &cur_acl->list); + LIST_APPEND(known_acl, &cur_acl->list); return cur_acl; @@ -990,9 +990,9 @@ struct acl_cond *parse_acl_cond(const char **args, struct list *known_acl, goto out_free_term; } LIST_INIT(&cur_suite->terms); - LIST_ADDQ(&cond->suites, &cur_suite->list); + LIST_APPEND(&cond->suites, &cur_suite->list); } - LIST_ADDQ(&cur_suite->terms, &cur_term->list); + LIST_APPEND(&cur_suite->terms, &cur_term->list); neg = 0; } @@ -1313,10 +1313,10 @@ void free_acl_cond(struct acl_cond *cond) list_for_each_entry_safe(suite, suiteb, &cond->suites, list) { list_for_each_entry_safe(term, termb, &suite->terms, list) { - LIST_DEL(&term->list); + LIST_DELETE(&term->list); free(term); } - LIST_DEL(&suite->list); + LIST_DELETE(&suite->list); free(suite); } diff --git a/src/action.c b/src/action.c index b9d12c0302..5e430f23ab 100644 --- a/src/action.c +++ b/src/action.c @@ -289,7 +289,7 @@ void free_act_rules(struct list *rules) struct act_rule *rule, *ruleb; list_for_each_entry_safe(rule, ruleb, rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); free_acl_cond(rule->cond); if (rule->release_ptr) rule->release_ptr(rule); diff --git a/src/arg.c b/src/arg.c index 31e7e02c4d..8b3dccf31f 100644 --- a/src/arg.c +++ b/src/arg.c @@ -78,7 +78,7 @@ struct arg_list *arg_list_add(struct arg_list *orig, struct arg *arg, int pos) if (new) { new->arg = arg; new->arg_pos = pos; - LIST_ADDQ(&orig->list, &new->list); + LIST_APPEND(&orig->list, &new->list); } return new; } diff --git a/src/backend.c b/src/backend.c index fe9bda50e1..8b06ddb779 100644 --- a/src/backend.c +++ b/src/backend.c @@ -1472,7 +1472,7 @@ int connect_server(struct stream *s) if (tokill_conn) { /* We got one, put it into the concerned thread's to kill list, and wake it's kill task */ - MT_LIST_ADDQ(&idle_conns[i].toremove_conns, + MT_LIST_APPEND(&idle_conns[i].toremove_conns, (struct mt_list *)&tokill_conn->toremove_list); task_wakeup(idle_conns[i].cleanup_task, TASK_WOKEN_OTHER); break; diff --git a/src/cache.c b/src/cache.c index 0eb6a88820..b9080d4a84 100644 --- a/src/cache.c +++ b/src/cache.c @@ -1581,7 +1581,7 @@ static int parse_cache_rule(struct proxy *proxy, const char *name, struct act_ru fconf->id = cache_store_flt_id; fconf->conf = cconf; fconf->ops = &cache_ops; - LIST_ADDQ(&proxy->filter_configs, &fconf->list); + LIST_APPEND(&proxy->filter_configs, &fconf->list); rule->arg.act.p[0] = cconf; return 1; @@ -2052,7 +2052,7 @@ int cfg_post_parse_section_cache() /* add to the list of cache to init and reinit tmp_cache_config * for next cache section, if any. */ - LIST_ADDQ(&caches_config, &tmp_cache_config->list); + LIST_APPEND(&caches_config, &tmp_cache_config->list); tmp_cache_config = NULL; return err_code; } @@ -2091,8 +2091,8 @@ int post_check_cache() memcpy(shctx->data, cache_config, sizeof(struct cache)); cache = (struct cache *)shctx->data; cache->entries = EB_ROOT; - LIST_ADDQ(&caches, &cache->list); - LIST_DEL(&cache_config->list); + LIST_APPEND(&caches, &cache->list); + LIST_DELETE(&cache_config->list); free(cache_config); /* Find all references for this cache in the existing filters @@ -2511,7 +2511,7 @@ parse_cache_flt(char **args, int *cur_arg, struct proxy *px, } /* Remove the implicit filter. is kept for the explicit one */ - LIST_DEL(&f->list); + LIST_DELETE(&f->list); free(f); free(name); break; diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c index b2c81da611..8a81b442d7 100644 --- a/src/cfgparse-listen.c +++ b/src/cfgparse-listen.c @@ -1216,7 +1216,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) (curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, file, linenum); - LIST_ADDQ(&curproxy->http_req_rules, &rule->list); + LIST_APPEND(&curproxy->http_req_rules, &rule->list); } else if (strcmp(args[0], "http-response") == 0) { /* response access control */ struct act_rule *rule; @@ -1246,7 +1246,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) (curproxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, file, linenum); - LIST_ADDQ(&curproxy->http_res_rules, &rule->list); + LIST_APPEND(&curproxy->http_res_rules, &rule->list); } else if (strcmp(args[0], "http-after-response") == 0) { struct act_rule *rule; @@ -1276,7 +1276,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) (curproxy->cap & PR_CAP_BE) ? SMP_VAL_BE_HRS_HDR : SMP_VAL_FE_HRS_HDR, file, linenum); - LIST_ADDQ(&curproxy->http_after_res_rules, &rule->list); + LIST_APPEND(&curproxy->http_after_res_rules, &rule->list); } else if (strcmp(args[0], "http-send-name-header") == 0) { /* send server name in request header */ /* set the header name and length into the proxy structure */ @@ -1320,7 +1320,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto out; } - LIST_ADDQ(&curproxy->redirect_rules, &rule->list); + LIST_APPEND(&curproxy->redirect_rules, &rule->list); err_code |= warnif_misplaced_redirect(curproxy, file, linenum, args[0]); err_code |= warnif_cond_conflicts(rule->cond, (curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, @@ -1381,7 +1381,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto alloc_error; } LIST_INIT(&rule->list); - LIST_ADDQ(&curproxy->switching_rules, &rule->list); + LIST_APPEND(&curproxy->switching_rules, &rule->list); } else if (strcmp(args[0], "use-server") == 0) { struct server_rule *rule; @@ -1437,7 +1437,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto alloc_error; } LIST_INIT(&rule->list); - LIST_ADDQ(&curproxy->server_rules, &rule->list); + LIST_APPEND(&curproxy->server_rules, &rule->list); curproxy->be_req_ana |= AN_REQ_SRV_RULES; } else if ((strcmp(args[0], "force-persist") == 0) || @@ -1486,7 +1486,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) rule->type = PERSIST_TYPE_IGNORE; } LIST_INIT(&rule->list); - LIST_ADDQ(&curproxy->persist_rules, &rule->list); + LIST_APPEND(&curproxy->persist_rules, &rule->list); } else if (strcmp(args[0], "stick-table") == 0) { struct stktable *other; @@ -1653,9 +1653,9 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) rule->table.name = name ? strdup(name) : NULL; LIST_INIT(&rule->list); if (flags & STK_ON_RSP) - LIST_ADDQ(&curproxy->storersp_rules, &rule->list); + LIST_APPEND(&curproxy->storersp_rules, &rule->list); else - LIST_ADDQ(&curproxy->sticking_rules, &rule->list); + LIST_APPEND(&curproxy->sticking_rules, &rule->list); } else if (strcmp(args[0], "stats") == 0) { if (!(curproxy->cap & PR_CAP_DEF) && curproxy->uri_auth == curr_defproxy->uri_auth) @@ -1701,7 +1701,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) } rule->cond = cond; LIST_INIT(&rule->list); - LIST_ADDQ(&curproxy->uri_auth->admin_rules, &rule->list); + LIST_APPEND(&curproxy->uri_auth->admin_rules, &rule->list); } else if (strcmp(args[1], "uri") == 0) { if (*(args[2]) == 0) { ha_alert("parsing [%s:%d] : 'uri' needs an URI prefix.\n", file, linenum); @@ -1768,7 +1768,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) err_code |= warnif_cond_conflicts(rule->cond, (curproxy->cap & PR_CAP_FE) ? SMP_VAL_FE_HRQ_HDR : SMP_VAL_BE_HRQ_HDR, file, linenum); - LIST_ADDQ(&curproxy->uri_auth->http_req_rules, &rule->list); + LIST_APPEND(&curproxy->uri_auth->http_req_rules, &rule->list); } else if (strcmp(args[1], "auth") == 0) { if (*(args[2]) == 0) { @@ -2418,7 +2418,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) err_code |= ERR_ALERT | ERR_FATAL; goto out; } - LIST_ADDQ(&curproxy->mon_fail_cond, &cond->list); + LIST_APPEND(&curproxy->mon_fail_cond, &cond->list); } else { ha_alert("parsing [%s:%d] : '%s' only supports 'fail'.\n", file, linenum, args[0]); diff --git a/src/cfgparse-ssl.c b/src/cfgparse-ssl.c index 7d14fa0a9e..0a90da7ad4 100644 --- a/src/cfgparse-ssl.c +++ b/src/cfgparse-ssl.c @@ -1181,7 +1181,7 @@ static int bind_parse_tls_ticket_keys(char **args, int cur_arg, struct proxy *px HA_RWLOCK_INIT(&keys_ref->lock); conf->keys_ref = keys_ref; - LIST_ADD(&tlskeys_reference, &keys_ref->list); + LIST_INSERT(&tlskeys_reference, &keys_ref->list); return 0; diff --git a/src/cfgparse.c b/src/cfgparse.c index 47f04e5fc5..c6a93ee3c1 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2372,7 +2372,7 @@ int check_config_validity() /* Only one element in the list, a simple string: free the expression and * fall back to static rule */ - LIST_DEL(&node->list); + LIST_DELETE(&node->list); free(node->arg); free(node); } @@ -2437,7 +2437,7 @@ int check_config_validity() /* Only one element in the list, a simple string: free the expression and * fall back to static rule */ - LIST_DEL(&node->list); + LIST_DELETE(&node->list); free(node->arg); free(node); } @@ -2643,7 +2643,7 @@ int check_config_validity() break; } - LIST_ADDQ(&curproxy->uri_auth->http_req_rules, &rule->list); + LIST_APPEND(&curproxy->uri_auth->http_req_rules, &rule->list); if (curproxy->uri_auth->auth_realm) { ha_free(&curproxy->uri_auth->auth_realm); @@ -3766,7 +3766,7 @@ int check_config_validity() */ void cfg_register_keywords(struct cfg_kw_list *kwl) { - LIST_ADDQ(&cfg_keywords.list, &kwl->list); + LIST_APPEND(&cfg_keywords.list, &kwl->list); } /* @@ -3774,7 +3774,7 @@ void cfg_register_keywords(struct cfg_kw_list *kwl) */ void cfg_unregister_keywords(struct cfg_kw_list *kwl) { - LIST_DEL(&kwl->list); + LIST_DELETE(&kwl->list); LIST_INIT(&kwl->list); } @@ -3806,7 +3806,7 @@ int cfg_register_section(char *section_name, cs->section_parser = section_parser; cs->post_section_parser = post_section_parser; - LIST_ADDQ(§ions, &cs->list); + LIST_APPEND(§ions, &cs->list); return 1; } @@ -3827,7 +3827,7 @@ int cfg_register_postparser(char *name, int (*func)()) cp->name = name; cp->func = func; - LIST_ADDQ(&postparsers, &cp->list); + LIST_APPEND(&postparsers, &cp->list); return 1; } @@ -3840,7 +3840,7 @@ void cfg_unregister_sections(void) struct cfg_section *cs, *ics; list_for_each_entry_safe(cs, ics, §ions, list) { - LIST_DEL(&cs->list); + LIST_DELETE(&cs->list); free(cs); } } @@ -3850,8 +3850,8 @@ void cfg_backup_sections(struct list *backup_sections) struct cfg_section *cs, *ics; list_for_each_entry_safe(cs, ics, §ions, list) { - LIST_DEL(&cs->list); - LIST_ADDQ(backup_sections, &cs->list); + LIST_DELETE(&cs->list); + LIST_APPEND(backup_sections, &cs->list); } } @@ -3860,8 +3860,8 @@ void cfg_restore_sections(struct list *backup_sections) struct cfg_section *cs, *ics; list_for_each_entry_safe(cs, ics, backup_sections, list) { - LIST_DEL(&cs->list); - LIST_ADDQ(§ions, &cs->list); + LIST_DELETE(&cs->list); + LIST_APPEND(§ions, &cs->list); } } diff --git a/src/check.c b/src/check.c index e3778ea5b9..ee225a2827 100644 --- a/src/check.c +++ b/src/check.c @@ -1273,11 +1273,11 @@ struct buffer *check_get_buf(struct check *check, struct buffer *bptr) { struct buffer *buf = NULL; - if (likely(!LIST_ADDED(&check->buf_wait.list)) && + if (likely(!LIST_INLIST(&check->buf_wait.list)) && unlikely((buf = b_alloc(bptr)) == NULL)) { check->buf_wait.target = check; check->buf_wait.wakeup_cb = check_buf_available; - LIST_ADDQ(&ti->buffer_wq, &check->buf_wait.list); + LIST_APPEND(&ti->buffer_wq, &check->buf_wait.list); } return buf; } @@ -1701,7 +1701,7 @@ static int init_srv_agent_check(struct server *srv) } chk->action = TCPCHK_ACT_CONNECT; chk->connect.options = (TCPCHK_OPT_DEFAULT_CONNECT|TCPCHK_OPT_IMPLICIT); - LIST_ADD(srv->agent.tcpcheck_rules->list, &chk->list); + LIST_INSERT(srv->agent.tcpcheck_rules->list, &chk->list); } @@ -1874,7 +1874,7 @@ static int srv_parse_agent_check(char **args, int *cur_arg, struct proxy *curpx, goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""}, 1, curpx, &rs->rules, TCPCHK_RULES_AGENT_CHK, @@ -1885,7 +1885,7 @@ static int srv_parse_agent_check(char **args, int *cur_arg, struct proxy *curpx, } chk->expect.custom = tcpcheck_agent_expect_reply; chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -1986,7 +1986,7 @@ int set_srv_agent_send(struct server *srv, const char *send) var->data.u.str.area = str; var->data.u.str.data = strlen(str); LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); return 1; diff --git a/src/cli.c b/src/cli.c index 13603df5dd..162daa62d2 100644 --- a/src/cli.c +++ b/src/cli.c @@ -338,7 +338,7 @@ struct cli_kw* cli_find_kw_exact(char **args) void cli_register_kw(struct cli_kw_list *kw_list) { - LIST_ADDQ(&cli_keywords.list, &kw_list->list); + LIST_APPEND(&cli_keywords.list, &kw_list->list); } diff --git a/src/dns.c b/src/dns.c index 5e991fe556..a6b8fa7cb8 100644 --- a/src/dns.c +++ b/src/dns.c @@ -206,13 +206,13 @@ ssize_t dns_recv_nameserver(struct dns_nameserver *ns, void *data, size_t size) * so we can add if to free_sess list * to receive a new request */ - LIST_ADD(&ds->dss->free_sess, &ds->list); + LIST_INSERT(&ds->dss->free_sess, &ds->list); } else { /* there is no more pipelined requests * into this session, so we move it * to idle_sess list */ - LIST_ADD(&ds->dss->idle_sess, &ds->list); + LIST_INSERT(&ds->dss->idle_sess, &ds->list); /* update the counter of idle sessions */ ds->dss->idle_conns++; @@ -548,7 +548,7 @@ static void dns_session_io_handler(struct appctx *appctx) * to destroy the task */ task_queue(ds->task_exp); } - LIST_ADDQ(&ds->queries, &query->list); + LIST_APPEND(&ds->queries, &query->list); eb32_insert(&ds->query_ids, &query->qid); ds->onfly_queries++; } @@ -613,7 +613,7 @@ static void dns_session_io_handler(struct appctx *appctx) if (ret) { /* let's be woken up once new request to write arrived */ HA_RWLOCK_WRLOCK(DNS_LOCK, &ring->lock); - LIST_ADDQ(&ring->waiters, &appctx->wait_entry); + LIST_APPEND(&ring->waiters, &appctx->wait_entry); HA_RWLOCK_WRUNLOCK(DNS_LOCK, &ring->lock); si_rx_endp_done(si); } @@ -626,7 +626,7 @@ static void dns_session_io_handler(struct appctx *appctx) * delete from the list */ __ha_barrier_load(); - if (!LIST_ADDED(&ds->waiter)) { + if (!LIST_INLIST(&ds->waiter)) { while (1) { uint16_t query_id; struct eb32_node *eb; @@ -697,7 +697,7 @@ static void dns_session_io_handler(struct appctx *appctx) /* remove query ids mapping from pending queries list/tree */ eb32_delete(&query->qid); - LIST_DEL(&query->list); + LIST_DELETE(&query->list); pool_free(dns_query_pool, query); ds->onfly_queries--; @@ -708,7 +708,7 @@ static void dns_session_io_handler(struct appctx *appctx) * wait_sess list where the task processing * response will pop available responses */ - LIST_ADDQ(&ds->dss->wait_sess, &ds->waiter); + LIST_APPEND(&ds->dss->wait_sess, &ds->waiter); /* lock the dns_stream_server containing lists heads */ HA_SPIN_UNLOCK(DNS_LOCK, &ds->dss->lock); @@ -719,7 +719,7 @@ static void dns_session_io_handler(struct appctx *appctx) break; } - if (!LIST_ADDED(&ds->waiter)) { + if (!LIST_INLIST(&ds->waiter)) { /* there is no more pending data to read and the con was closed by the server side */ if (!co_data(si_oc(si)) && (si_oc(si)->flags & CF_SHUTW)) { goto close; @@ -742,7 +742,7 @@ void dns_queries_flush(struct dns_session *ds) list_for_each_entry_safe(query, queryb, &ds->queries, list) { eb32_delete(&query->qid); - LIST_DEL(&query->list); + LIST_DELETE(&query->list); pool_free(dns_query_pool, query); } } @@ -824,7 +824,7 @@ static void dns_session_release(struct appctx *appctx) * message offsets if the session * was closed with an incomplete pending response */ - if (!LIST_ADDED(&ds->waiter)) + if (!LIST_INLIST(&ds->waiter)) ds->rx_msg.len = ds->rx_msg.offset = 0; /* we flush pending sent queries because we never @@ -850,7 +850,7 @@ static void dns_session_release(struct appctx *appctx) } if (ds->nb_queries < DNS_STREAM_MAX_PIPELINED_REQ) - LIST_ADD(&ds->dss->free_sess, &ds->list); + LIST_INSERT(&ds->dss->free_sess, &ds->list); HA_SPIN_UNLOCK(DNS_LOCK, &dss->lock); } @@ -912,7 +912,7 @@ static struct appctx *dns_session_create(struct dns_session *ds) /* Error unrolling */ out_free_strm: - LIST_DEL(&s->list); + LIST_DELETE(&s->list); pool_free(pool_head_stream, s); out_free_sess: session_free(sess); @@ -935,7 +935,7 @@ static struct task *dns_process_query_exp(struct task *t, void *context, unsigne list_for_each_entry_safe(query, queryb, &ds->queries, list) { if (tick_is_expired(query->expire, now_ms)) { eb32_delete(&query->qid); - LIST_DEL(&query->list); + LIST_DELETE(&query->list); pool_free(dns_query_pool, query); ds->onfly_queries--; } @@ -1130,7 +1130,7 @@ static struct task *dns_process_req(struct task *t, void *context, unsigned int * it may be close to be full so we put it at the end * of free conn list */ LIST_DEL_INIT(&ds->list); - LIST_ADDQ(&dss->free_sess, &ds->list); + LIST_APPEND(&dss->free_sess, &ds->list); } } @@ -1154,7 +1154,7 @@ static struct task *dns_process_req(struct task *t, void *context, unsigned int * this request, this request may be large and fill * the ring buffer so we prefer to put at the end of free * list. */ - LIST_ADDQ(&dss->free_sess, &ds->list); + LIST_APPEND(&dss->free_sess, &ds->list); ads = ds; } } @@ -1167,7 +1167,7 @@ static struct task *dns_process_req(struct task *t, void *context, unsigned int /* ring is empty so this ring_write should never fail */ ring_write(&ads->ring, DNS_TCP_MSG_MAX_SIZE, NULL, 0, &myist, 1); ads->nb_queries++; - LIST_ADD(&dss->free_sess, &ads->list); + LIST_INSERT(&dss->free_sess, &ads->list); } else ns->counters->snd_error++; diff --git a/src/extcheck.c b/src/extcheck.c index 808b4bb714..aa342fc840 100644 --- a/src/extcheck.c +++ b/src/extcheck.c @@ -124,7 +124,7 @@ static struct pid_list *pid_list_add(pid_t pid, struct task *t) LIST_INIT(&elem->list); HA_SPIN_LOCK(PID_LIST_LOCK, &pid_list_lock); - LIST_ADD(&pid_list, &elem->list); + LIST_INSERT(&pid_list, &elem->list); HA_SPIN_UNLOCK(PID_LIST_LOCK, &pid_list_lock); return elem; @@ -138,7 +138,7 @@ static void pid_list_del(struct pid_list *elem) return; HA_SPIN_LOCK(PID_LIST_LOCK, &pid_list_lock); - LIST_DEL(&elem->list); + LIST_DELETE(&elem->list); HA_SPIN_UNLOCK(PID_LIST_LOCK, &pid_list_lock); if (!elem->exited) diff --git a/src/fcgi-app.c b/src/fcgi-app.c index 239870903d..6dca3ecfff 100644 --- a/src/fcgi-app.c +++ b/src/fcgi-app.c @@ -141,7 +141,7 @@ static void fcgi_release_rule(struct fcgi_rule *rule) struct logformat_node *lf, *lfb; list_for_each_entry_safe(lf, lfb, &rule->value, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -205,12 +205,12 @@ static void fcgi_flt_deinit(struct proxy *px, struct flt_conf *fconf) free(fcgi_conf->name); list_for_each_entry_safe(rule, back, &fcgi_conf->param_rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); fcgi_release_rule(rule); } list_for_each_entry_safe(rule, back, &fcgi_conf->hdr_rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); fcgi_release_rule(rule); } @@ -270,9 +270,9 @@ static int fcgi_flt_check(struct proxy *px, struct flt_conf *fconf) } if (rule->type == FCGI_RULE_SET_PARAM || rule->type == FCGI_RULE_UNSET_PARAM) - LIST_ADDQ(&fcgi_conf->param_rules, &rule->list); + LIST_APPEND(&fcgi_conf->param_rules, &rule->list); else /* FCGI_RULE_PASS_HDR/FCGI_RULE_HIDE_HDR */ - LIST_ADDQ(&fcgi_conf->hdr_rules, &rule->list); + LIST_APPEND(&fcgi_conf->hdr_rules, &rule->list); rule = NULL; } return 0; @@ -549,7 +549,7 @@ parse_fcgi_flt(char **args, int *cur_arg, struct proxy *px, } /* Place the filter at its right position */ - LIST_DEL(&f->list); + LIST_DELETE(&f->list); free(f); ha_free(&name); break; @@ -627,7 +627,7 @@ static int proxy_parse_use_fcgi_app(char **args, int section, struct proxy *curp fconf->id = fcgi_flt_id; fconf->conf = fcgi_conf; fconf->ops = &fcgi_flt_ops; - LIST_ADDQ(&curpx->filter_configs, &fconf->list); + LIST_APPEND(&curpx->filter_configs, &fconf->list); end: return retval; @@ -743,7 +743,7 @@ static int fcgi_app_add_rule(struct fcgi_app *curapp, enum fcgi_rule_type type, goto err; } rule->cond = cond; - LIST_ADDQ(&curapp->conf.rules, &rule->list); + LIST_APPEND(&curapp->conf.rules, &rule->list); return 1; err: @@ -1090,12 +1090,12 @@ void fcgi_apps_deinit() free(curapp->conf.file); list_for_each_entry_safe(log, logb, &curapp->logsrvs, list) { - LIST_DEL(&log->list); + LIST_DELETE(&log->list); free(log); } list_for_each_entry_safe(rule, back, &curapp->conf.rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); fcgi_release_rule_conf(rule); } diff --git a/src/filters.c b/src/filters.c index 859092be5a..2075beefa7 100644 --- a/src/filters.c +++ b/src/filters.c @@ -89,7 +89,7 @@ static struct flt_kw_list flt_keywords = { void flt_register_keywords(struct flt_kw_list *kwl) { - LIST_ADDQ(&flt_keywords.list, &kwl->list); + LIST_APPEND(&flt_keywords.list, &kwl->list); } /* @@ -238,7 +238,7 @@ parse_filter(char **args, int section_type, struct proxy *curpx, goto error; } - LIST_ADDQ(&curpx->filter_configs, &fconf->list); + LIST_APPEND(&curpx->filter_configs, &fconf->list); } return 0; @@ -358,7 +358,7 @@ flt_deinit(struct proxy *proxy) list_for_each_entry_safe(fconf, back, &proxy->filter_configs, list) { if (fconf->ops->deinit) fconf->ops->deinit(proxy, fconf); - LIST_DEL(&fconf->list); + LIST_DELETE(&fconf->list); free(fconf); } } @@ -412,7 +412,7 @@ flt_stream_add_filter(struct stream *s, struct flt_conf *fconf, unsigned int fla } } - LIST_ADDQ(&strm_flt(s)->filters, &f->list); + LIST_APPEND(&strm_flt(s)->filters, &f->list); strm_flt(s)->flags |= STRM_FLT_FL_HAS_FILTERS; return 0; } @@ -450,7 +450,7 @@ flt_stream_release(struct stream *s, int only_backend) if (!only_backend || (filter->flags & FLT_FL_IS_BACKEND_FILTER)) { if (FLT_OPS(filter)->detach) FLT_OPS(filter)->detach(s, filter); - LIST_DEL(&filter->list); + LIST_DELETE(&filter->list); pool_free(pool_head_filter, filter); } } diff --git a/src/flt_http_comp.c b/src/flt_http_comp.c index 99718e3ce3..c212b9c464 100644 --- a/src/flt_http_comp.c +++ b/src/flt_http_comp.c @@ -753,7 +753,7 @@ check_implicit_http_comp_flt(struct proxy *proxy) fconf->id = http_comp_flt_id; fconf->conf = NULL; fconf->ops = &comp_ops; - LIST_ADDQ(&proxy->filter_configs, &fconf->list); + LIST_APPEND(&proxy->filter_configs, &fconf->list); end: return err; } diff --git a/src/flt_spoe.c b/src/flt_spoe.c index ce5548344b..7749cc98cc 100644 --- a/src/flt_spoe.c +++ b/src/flt_spoe.c @@ -128,11 +128,11 @@ spoe_release_message(struct spoe_message *msg) list_for_each_entry_safe(arg, argback, &msg->args, list) { release_sample_expr(arg->expr); free(arg->name); - LIST_DEL(&arg->list); + LIST_DELETE(&arg->list); free(arg); } list_for_each_entry_safe(acl, aclback, &msg->acls, list) { - LIST_DEL(&acl->list); + LIST_DELETE(&acl->list); prune_acl(acl); free(acl); } @@ -169,11 +169,11 @@ spoe_release_agent(struct spoe_agent *agent) free(agent->var_t_process); free(agent->var_t_total); list_for_each_entry_safe(msg, msgback, &agent->messages, list) { - LIST_DEL(&msg->list); + LIST_DELETE(&msg->list); spoe_release_message(msg); } list_for_each_entry_safe(grp, grpback, &agent->groups, list) { - LIST_DEL(&grp->list); + LIST_DELETE(&grp->list); spoe_release_group(grp); } if (agent->rt) { @@ -1233,7 +1233,7 @@ spoe_release_appctx(struct appctx *appctx) _HA_ATOMIC_DEC(&agent->counters.applets); HA_SPIN_LOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock); if (!LIST_ISEMPTY(&spoe_appctx->list)) { - LIST_DEL(&spoe_appctx->list); + LIST_DELETE(&spoe_appctx->list); LIST_INIT(&spoe_appctx->list); } HA_SPIN_UNLOCK(SPOE_APPLET_LOCK, &agent->rt[tid].lock); @@ -1259,7 +1259,7 @@ spoe_release_appctx(struct appctx *appctx) /* Notify all waiting streams */ list_for_each_entry_safe(ctx, back, &spoe_appctx->waiting_queue, list) { - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_waiting); spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting); @@ -1289,7 +1289,7 @@ spoe_release_appctx(struct appctx *appctx) /* If this was the last running applet, notify all waiting streams */ list_for_each_entry_safe(ctx, back, &agent->rt[tid].sending_queue, list) { - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_sending); spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue); @@ -1299,7 +1299,7 @@ spoe_release_appctx(struct appctx *appctx) task_wakeup(ctx->strm->task, TASK_WOKEN_MSG); } list_for_each_entry_safe(ctx, back, &agent->rt[tid].waiting_queue, list) { - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_waiting); spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting); @@ -1500,7 +1500,7 @@ spoe_handle_sending_frame_appctx(struct appctx *appctx, int *skip) goto abort_frag_frame; spoe_release_buffer(&ctx->buffer, &ctx->buffer_wait); - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_sending); spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue); @@ -1520,7 +1520,7 @@ spoe_handle_sending_frame_appctx(struct appctx *appctx, int *skip) goto abort_frag_frame; spoe_release_buffer(&ctx->buffer, &ctx->buffer_wait); - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_sending); spoe_update_stat_time(&ctx->stats.tv_queue, &ctx->stats.t_queue); @@ -1546,16 +1546,16 @@ spoe_handle_sending_frame_appctx(struct appctx *appctx, int *skip) no_frag_frame_sent: if (SPOE_APPCTX(appctx)->flags & SPOE_APPCTX_FL_ASYNC) { appctx->st0 = SPOE_APPCTX_ST_PROCESSING; - LIST_ADDQ(&agent->rt[tid].waiting_queue, &ctx->list); + LIST_APPEND(&agent->rt[tid].waiting_queue, &ctx->list); } else if (SPOE_APPCTX(appctx)->flags & SPOE_APPCTX_FL_PIPELINING) { appctx->st0 = SPOE_APPCTX_ST_PROCESSING; - LIST_ADDQ(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list); + LIST_APPEND(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list); } else { appctx->st0 = SPOE_APPCTX_ST_WAITING_SYNC_ACK; *skip = 1; - LIST_ADDQ(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list); + LIST_APPEND(&SPOE_APPCTX(appctx)->waiting_queue, &ctx->list); } _HA_ATOMIC_INC(&agent->counters.nb_waiting); ctx->stats.tv_wait = now; @@ -1611,7 +1611,7 @@ spoe_handle_receiving_frame_appctx(struct appctx *appctx, int *skip) break; default: - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); _HA_ATOMIC_DEC(&agent->counters.nb_waiting); spoe_update_stat_time(&ctx->stats.tv_wait, &ctx->stats.t_waiting); @@ -2008,7 +2008,7 @@ spoe_create_appctx(struct spoe_config *conf) strm->res.flags |= CF_READ_DONTWAIT; HA_SPIN_LOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock); - LIST_ADDQ(&conf->agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list); + LIST_APPEND(&conf->agent->rt[tid].applets, &SPOE_APPCTX(appctx)->list); HA_SPIN_UNLOCK(SPOE_APPLET_LOCK, &conf->agent->rt[tid].lock); _HA_ATOMIC_INC(&conf->agent->counters.applets); @@ -2101,7 +2101,7 @@ spoe_queue_context(struct spoe_context *ctx) ctx->stats.tv_queue = now; if (ctx->spoe_appctx) return 1; - LIST_ADDQ(&agent->rt[tid].sending_queue, &ctx->list); + LIST_APPEND(&agent->rt[tid].sending_queue, &ctx->list); SPOE_PRINTF(stderr, "%d.%06d [SPOE/%-15s] %s: stream=%p" " - Add stream in sending queue" @@ -2624,7 +2624,7 @@ spoe_stop_processing(struct spoe_agent *agent, struct spoe_context *ctx) else _HA_ATOMIC_DEC(&agent->counters.nb_waiting); - LIST_DEL(&ctx->list); + LIST_DELETE(&ctx->list); LIST_INIT(&ctx->list); } } @@ -2833,20 +2833,20 @@ spoe_acquire_buffer(struct buffer *buf, struct buffer_wait *buffer_wait) if (buf->size) return 1; - if (LIST_ADDED(&buffer_wait->list)) + if (LIST_INLIST(&buffer_wait->list)) LIST_DEL_INIT(&buffer_wait->list); if (b_alloc(buf)) return 1; - LIST_ADDQ(&ti->buffer_wq, &buffer_wait->list); + LIST_APPEND(&ti->buffer_wq, &buffer_wait->list); return 0; } static void spoe_release_buffer(struct buffer *buf, struct buffer_wait *buffer_wait) { - if (LIST_ADDED(&buffer_wait->list)) + if (LIST_INLIST(&buffer_wait->list)) LIST_DEL_INIT(&buffer_wait->list); /* Release the buffer if needed */ @@ -3439,7 +3439,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) goto out; } ph->id = strdup(args[cur_arg]); - LIST_ADDQ(&curmphs, &ph->list); + LIST_APPEND(&curmphs, &ph->list); cur_arg++; } } @@ -3463,7 +3463,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) goto out; } ph->id = strdup(args[cur_arg]); - LIST_ADDQ(&curgphs, &ph->list); + LIST_APPEND(&curgphs, &ph->list); cur_arg++; } } @@ -3766,7 +3766,7 @@ cfg_parse_spoe_agent(const char *file, int linenum, char **args, int kwm) err_code |= ERR_ALERT | ERR_ABORT; goto out; } - LIST_ADDQ(&curvars, &vph->list); + LIST_APPEND(&curvars, &vph->list); cur_arg++; } } @@ -3841,7 +3841,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm) curgrp->conf.line = linenum; LIST_INIT(&curgrp->phs); LIST_INIT(&curgrp->messages); - LIST_ADDQ(&curgrps, &curgrp->list); + LIST_APPEND(&curgrps, &curgrp->list); } else if (strcmp(args[0], "messages") == 0) { int cur_arg = 1; @@ -3863,7 +3863,7 @@ cfg_parse_spoe_group(const char *file, int linenum, char **args, int kwm) goto out; } ph->id = strdup(args[cur_arg]); - LIST_ADDQ(&curgrp->phs, &ph->list); + LIST_APPEND(&curgrp->phs, &ph->list); cur_arg++; } } @@ -3937,7 +3937,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm) LIST_INIT(&curmsg->acls); LIST_INIT(&curmsg->by_evt); LIST_INIT(&curmsg->by_grp); - LIST_ADDQ(&curmsgs, &curmsg->list); + LIST_APPEND(&curmsgs, &curmsg->list); } else if (strcmp(args[0], "args") == 0) { int cur_arg = 1; @@ -3976,7 +3976,7 @@ cfg_parse_spoe_message(const char *file, int linenum, char **args, int kwm) goto out; } curmsg->nargs++; - LIST_ADDQ(&curmsg->args, &arg->list); + LIST_APPEND(&curmsg->args, &arg->list); cur_arg++; } curproxy->conf.args.file = NULL; @@ -4342,7 +4342,7 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, } msg->agent = curagent; - LIST_ADDQ(&curagent->events[msg->event], &msg->by_evt); + LIST_APPEND(&curagent->events[msg->event], &msg->by_evt); goto next_mph; } } @@ -4359,8 +4359,8 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, list_for_each_entry_safe(grp, grpback, &curgrps, list) { if (strcmp(grp->id, ph->id) == 0) { grp->agent = curagent; - LIST_DEL(&grp->list); - LIST_ADDQ(&curagent->groups, &grp->list); + LIST_DELETE(&grp->list); + LIST_APPEND(&curagent->groups, &grp->list); goto next_aph; } } @@ -4390,8 +4390,8 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, * them only if a rule use the corresponding SPOE group. */ msg->agent = curagent; msg->group = grp; - LIST_DEL(&ph->list); - LIST_ADDQ(&grp->messages, &msg->by_grp); + LIST_DELETE(&ph->list); + LIST_APPEND(&grp->messages, &msg->by_grp); goto next_mph_grp; } } @@ -4423,16 +4423,16 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, conf->agent_fe.options2 |= curpxopts2; list_for_each_entry_safe(logsrv, logsrvback, &curlogsrvs, list) { - LIST_DEL(&logsrv->list); - LIST_ADDQ(&conf->agent_fe.logsrvs, &logsrv->list); + LIST_DELETE(&logsrv->list); + LIST_APPEND(&conf->agent_fe.logsrvs, &logsrv->list); } list_for_each_entry_safe(ph, phback, &curmphs, list) { - LIST_DEL(&ph->list); + LIST_DELETE(&ph->list); spoe_release_placeholder(ph); } list_for_each_entry_safe(ph, phback, &curgphs, list) { - LIST_DEL(&ph->list); + LIST_DELETE(&ph->list); spoe_release_placeholder(ph); } list_for_each_entry_safe(vph, vphback, &curvars, list) { @@ -4451,12 +4451,12 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, goto error; } - LIST_DEL(&vph->list); + LIST_DELETE(&vph->list); free(vph->name); free(vph); } list_for_each_entry_safe(grp, grpback, &curgrps, list) { - LIST_DEL(&grp->list); + LIST_DELETE(&grp->list); spoe_release_group(grp); } *cur_arg = pos; @@ -4468,28 +4468,28 @@ parse_spoe_flt(char **args, int *cur_arg, struct proxy *px, error: spoe_release_agent(curagent); list_for_each_entry_safe(ph, phback, &curmphs, list) { - LIST_DEL(&ph->list); + LIST_DELETE(&ph->list); spoe_release_placeholder(ph); } list_for_each_entry_safe(ph, phback, &curgphs, list) { - LIST_DEL(&ph->list); + LIST_DELETE(&ph->list); spoe_release_placeholder(ph); } list_for_each_entry_safe(vph, vphback, &curvars, list) { - LIST_DEL(&vph->list); + LIST_DELETE(&vph->list); free(vph->name); free(vph); } list_for_each_entry_safe(grp, grpback, &curgrps, list) { - LIST_DEL(&grp->list); + LIST_DELETE(&grp->list); spoe_release_group(grp); } list_for_each_entry_safe(msg, msgback, &curmsgs, list) { - LIST_DEL(&msg->list); + LIST_DELETE(&msg->list); spoe_release_message(msg); } list_for_each_entry_safe(logsrv, logsrvback, &curlogsrvs, list) { - LIST_DEL(&logsrv->list); + LIST_DELETE(&logsrv->list); free(logsrv); } free(conf); diff --git a/src/haproxy.c b/src/haproxy.c index 27ac49e900..0e86586b81 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -282,7 +282,7 @@ void hap_register_build_opts(const char *str, int must_free) } b->str = str; b->must_free = must_free; - LIST_ADDQ(&build_opts_list, &b->list); + LIST_APPEND(&build_opts_list, &b->list); } static void display_version() @@ -880,7 +880,7 @@ static void cfgfiles_expand_directories(void) /* remove the current directory (wl) from cfg_cfgfiles */ free(wl->s); - LIST_DEL(&wl->list); + LIST_DELETE(&wl->list); free(wl); } @@ -1463,7 +1463,7 @@ static void init(int argc, char **argv) ha_alert("Cannot allocate memory\n"); exit(EXIT_FAILURE); } - LIST_ADD(&mworker_cli_conf, &c->list); + LIST_INSERT(&mworker_cli_conf, &c->list); argv++; argc--; @@ -1654,7 +1654,7 @@ static void init(int argc, char **argv) proc_self = tmproc; - LIST_ADDQ(&proc_list, &tmproc->list); + LIST_APPEND(&proc_list, &tmproc->list); } for (proc = 0; proc < global.nbproc; proc++) { @@ -1677,7 +1677,7 @@ static void init(int argc, char **argv) exit(EXIT_FAILURE); } - LIST_ADDQ(&proc_list, &tmproc->list); + LIST_APPEND(&proc_list, &tmproc->list); } } if (global.mode & (MODE_MWORKER|MODE_MWORKER_WAIT)) { @@ -1699,7 +1699,7 @@ static void init(int argc, char **argv) ha_alert("Can't create the master's CLI.\n"); exit(EXIT_FAILURE); } - LIST_DEL(&c->list); + LIST_DELETE(&c->list); free(c->s); free(c); } @@ -2277,69 +2277,69 @@ void deinit(void) idle_conn_task = NULL; list_for_each_entry_safe(log, logb, &global.logsrvs, list) { - LIST_DEL(&log->list); + LIST_DELETE(&log->list); free(log); } list_for_each_entry_safe(wl, wlb, &cfg_cfgfiles, list) { free(wl->s); - LIST_DEL(&wl->list); + LIST_DELETE(&wl->list); free(wl); } list_for_each_entry_safe(bol, bolb, &build_opts_list, list) { if (bol->must_free) free((void *)bol->str); - LIST_DEL(&bol->list); + LIST_DELETE(&bol->list); free(bol); } list_for_each_entry_safe(pxdf, pxdfb, &proxy_deinit_list, list) { - LIST_DEL(&pxdf->list); + LIST_DELETE(&pxdf->list); free(pxdf); } list_for_each_entry_safe(pdf, pdfb, &post_deinit_list, list) { - LIST_DEL(&pdf->list); + LIST_DELETE(&pdf->list); free(pdf); } list_for_each_entry_safe(srvdf, srvdfb, &server_deinit_list, list) { - LIST_DEL(&srvdf->list); + LIST_DELETE(&srvdf->list); free(srvdf); } list_for_each_entry_safe(pcf, pcfb, &post_check_list, list) { - LIST_DEL(&pcf->list); + LIST_DELETE(&pcf->list); free(pcf); } list_for_each_entry_safe(pscf, pscfb, &post_server_check_list, list) { - LIST_DEL(&pscf->list); + LIST_DELETE(&pscf->list); free(pscf); } list_for_each_entry_safe(ppcf, ppcfb, &post_proxy_check_list, list) { - LIST_DEL(&ppcf->list); + LIST_DELETE(&ppcf->list); free(ppcf); } list_for_each_entry_safe(tif, tifb, &per_thread_init_list, list) { - LIST_DEL(&tif->list); + LIST_DELETE(&tif->list); free(tif); } list_for_each_entry_safe(tdf, tdfb, &per_thread_deinit_list, list) { - LIST_DEL(&tdf->list); + LIST_DELETE(&tdf->list); free(tdf); } list_for_each_entry_safe(taf, tafb, &per_thread_alloc_list, list) { - LIST_DEL(&taf->list); + LIST_DELETE(&taf->list); free(taf); } list_for_each_entry_safe(tff, tffb, &per_thread_free_list, list) { - LIST_DEL(&tff->list); + LIST_DELETE(&tff->list); free(tff); } @@ -3004,7 +3004,7 @@ int main(int argc, char **argv) proc_self = child; continue; } - LIST_DEL(&child->list); + LIST_DELETE(&child->list); mworker_free_child(child); child = NULL; } diff --git a/src/hlua.c b/src/hlua.c index 5a67f02d19..f2276097f7 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -312,7 +312,7 @@ static inline struct hlua_function *new_hlua_function() fcn = calloc(1, sizeof(*fcn)); if (!fcn) return NULL; - LIST_ADDQ(&referenced_functions, &fcn->l); + LIST_APPEND(&referenced_functions, &fcn->l); for (i = 0; i < MAX_THREADS + 1; i++) fcn->function_ref[i] = -1; return fcn; @@ -324,7 +324,7 @@ static inline void release_hlua_function(struct hlua_function *fcn) return; if (fcn->name) ha_free(&fcn->name); - LIST_DEL(&fcn->l); + LIST_DELETE(&fcn->l); ha_free(&fcn); } @@ -6387,7 +6387,7 @@ __LJMP static int hlua_register_init(lua_State *L) WILL_LJMP(luaL_error(L, "Lua out of memory error.")); init->function_ref = ref; - LIST_ADDQ(&hlua_init_functions[hlua_state_id], &init->l); + LIST_APPEND(&hlua_init_functions[hlua_state_id], &init->l); return 0; } @@ -8499,7 +8499,7 @@ static int hlua_config_prepend_path(char **args, int section_type, struct proxy memprintf(err, "memory allocation failed"); goto err2; } - LIST_ADDQ(&prepend_path_list, &p->l); + LIST_APPEND(&prepend_path_list, &p->l); hlua_prepend_path(hlua_states[0], type, path); hlua_prepend_path(hlua_states[1], type, path); diff --git a/src/http_act.c b/src/http_act.c index aeb940fd5e..5da2d7d1ab 100644 --- a/src/http_act.c +++ b/src/http_act.c @@ -51,7 +51,7 @@ static void release_http_action(struct act_rule *rule) if (rule->arg.http.re) regex_free(rule->arg.http.re); list_for_each_entry_safe(lf, lfb, &rule->arg.http.fmt, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -1744,7 +1744,7 @@ static void release_http_redir(struct act_rule *rule) struct redirect_rule *redir; redir = rule->arg.redir; - LIST_DEL(&redir->list); + LIST_DELETE(&redir->list); if (redir->cond) { prune_acl_cond(redir->cond); free(redir->cond); @@ -1752,7 +1752,7 @@ static void release_http_redir(struct act_rule *rule) free(redir->rdr_str); free(redir->cookie_str); list_for_each_entry_safe(lf, lfb, &redir->rdr_fmt, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); free(lf); } free(redir); @@ -1876,14 +1876,14 @@ static void release_http_map(struct act_rule *rule) free(rule->arg.map.ref); list_for_each_entry_safe(lf, lfb, &rule->arg.map.key, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); } if (rule->action == 1) { list_for_each_entry_safe(lf, lfb, &rule->arg.map.value, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); diff --git a/src/http_htx.c b/src/http_htx.c index 2ddc50e423..c3422d47ac 100644 --- a/src/http_htx.c +++ b/src/http_htx.c @@ -1009,9 +1009,9 @@ void release_http_reply(struct http_reply *http_reply) ha_free(&http_reply->ctype); list_for_each_entry_safe(hdr, hdrb, &http_reply->hdrs, list) { - LIST_DEL(&hdr->list); + LIST_DELETE(&hdr->list); list_for_each_entry_safe(lf, lfb, &hdr->value, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -1027,7 +1027,7 @@ void release_http_reply(struct http_reply *http_reply) chunk_destroy(&http_reply->body.obj); else if (http_reply->type == HTTP_REPLY_LOGFMT) { list_for_each_entry_safe(lf, lfb, &http_reply->body.fmt, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -1100,12 +1100,12 @@ static void http_htx_deinit(void) free(http_errs->id); for (rc = 0; rc < HTTP_ERR_SIZE; rc++) release_http_reply(http_errs->replies[rc]); - LIST_DEL(&http_errs->list); + LIST_DELETE(&http_errs->list); free(http_errs); } list_for_each_entry_safe(http_rep, http_repb, &http_replies_list, list) { - LIST_DEL(&http_rep->list); + LIST_DELETE(&http_rep->list); release_http_reply(http_rep); } } @@ -1598,7 +1598,7 @@ struct http_reply *http_parse_http_reply(const char **args, int *orig_arg, struc memprintf(errmsg, "'%s' : out of memory", args[cur_arg-1]); goto error; } - LIST_ADDQ(&reply->hdrs, &hdr->list); + LIST_APPEND(&reply->hdrs, &hdr->list); LIST_INIT(&hdr->value); hdr->name = ist(strdup(args[cur_arg])); if (!isttest(hdr->name)) { @@ -1654,9 +1654,9 @@ struct http_reply *http_parse_http_reply(const char **args, int *orig_arg, struc "with an erorrfile.\n", px->conf.args.file, px->conf.args.line); list_for_each_entry_safe(hdr, hdrb, &reply->hdrs, list) { - LIST_DEL(&hdr->list); + LIST_DELETE(&hdr->list); list_for_each_entry_safe(lf, lfb, &hdr->value, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -1759,7 +1759,7 @@ static int proxy_parse_errorloc(char **args, int section, struct proxy *curpx, reply->ctype = NULL; LIST_INIT(&reply->hdrs); reply->body.errmsg = msg; - LIST_ADDQ(&http_replies_list, &reply->list); + LIST_APPEND(&http_replies_list, &reply->list); conf_err = calloc(1, sizeof(*conf_err)); if (!conf_err) { @@ -1774,7 +1774,7 @@ static int proxy_parse_errorloc(char **args, int section, struct proxy *curpx, conf_err->file = strdup(file); conf_err->line = line; - LIST_ADDQ(&curpx->conf.errors, &conf_err->list); + LIST_APPEND(&curpx->conf.errors, &conf_err->list); /* handle warning message */ if (*errmsg) @@ -1825,7 +1825,7 @@ static int proxy_parse_errorfile(char **args, int section, struct proxy *curpx, reply->ctype = NULL; LIST_INIT(&reply->hdrs); reply->body.errmsg = msg; - LIST_ADDQ(&http_replies_list, &reply->list); + LIST_APPEND(&http_replies_list, &reply->list); conf_err = calloc(1, sizeof(*conf_err)); if (!conf_err) { @@ -1839,7 +1839,7 @@ static int proxy_parse_errorfile(char **args, int section, struct proxy *curpx, conf_err->info.errorfile.reply = reply; conf_err->file = strdup(file); conf_err->line = line; - LIST_ADDQ(&curpx->conf.errors, &conf_err->list); + LIST_APPEND(&curpx->conf.errors, &conf_err->list); /* handle warning message */ if (*errmsg) @@ -1901,7 +1901,7 @@ static int proxy_parse_errorfiles(char **args, int section, struct proxy *curpx, } conf_err->file = strdup(file); conf_err->line = line; - LIST_ADDQ(&curpx->conf.errors, &conf_err->list); + LIST_APPEND(&curpx->conf.errors, &conf_err->list); out: return ret; @@ -1970,11 +1970,11 @@ static int proxy_parse_http_error(char **args, int section, struct proxy *curpx, conf_err->type = 1; conf_err->info.errorfile.status = reply->status; conf_err->info.errorfile.reply = reply; - LIST_ADDQ(&http_replies_list, &reply->list); + LIST_APPEND(&http_replies_list, &reply->list); } conf_err->file = strdup(file); conf_err->line = line; - LIST_ADDQ(&curpx->conf.errors, &conf_err->list); + LIST_APPEND(&curpx->conf.errors, &conf_err->list); /* handle warning message */ if (*errmsg) @@ -2036,7 +2036,7 @@ static int proxy_check_errors(struct proxy *px) } } next: - LIST_DEL(&conf_err->list); + LIST_DELETE(&conf_err->list); free(conf_err->file); free(conf_err); } @@ -2099,7 +2099,7 @@ int proxy_dup_default_conf_errors(struct proxy *curpx, const struct proxy *defpx } new_conf_err->file = strdup(conf_err->file); new_conf_err->line = conf_err->line; - LIST_ADDQ(&curpx->conf.errors, &new_conf_err->list); + LIST_APPEND(&curpx->conf.errors, &new_conf_err->list); new_conf_err = NULL; } ret = 1; @@ -2116,7 +2116,7 @@ void proxy_release_conf_errors(struct proxy *px) list_for_each_entry_safe(conf_err, conf_err_back, &px->conf.errors, list) { if (conf_err->type == 0) free(conf_err->info.errorfiles.name); - LIST_DEL(&conf_err->list); + LIST_DELETE(&conf_err->list); free(conf_err->file); free(conf_err); } @@ -2168,7 +2168,7 @@ static int cfg_parse_http_errors(const char *file, int linenum, char **args, int goto out; } - LIST_ADDQ(&http_errors_list, &curr_errs->list); + LIST_APPEND(&http_errors_list, &curr_errs->list); curr_errs->id = strdup(args[1]); curr_errs->conf.file = strdup(file); curr_errs->conf.line = linenum; diff --git a/src/init.c b/src/init.c index e94f51f681..ad80662655 100644 --- a/src/init.c +++ b/src/init.c @@ -84,7 +84,7 @@ void hap_register_post_check(int (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&post_check_list, &b->list); + LIST_APPEND(&post_check_list, &b->list); } /* used to register some initialization functions to call for each proxy after @@ -100,7 +100,7 @@ void hap_register_post_proxy_check(int (*fct)(struct proxy *)) exit(1); } b->fct = fct; - LIST_ADDQ(&post_proxy_check_list, &b->list); + LIST_APPEND(&post_proxy_check_list, &b->list); } /* used to register some initialization functions to call for each server after @@ -116,7 +116,7 @@ void hap_register_post_server_check(int (*fct)(struct server *)) exit(1); } b->fct = fct; - LIST_ADDQ(&post_server_check_list, &b->list); + LIST_APPEND(&post_server_check_list, &b->list); } /* used to register some de-initialization functions to call after everything @@ -132,7 +132,7 @@ void hap_register_post_deinit(void (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&post_deinit_list, &b->list); + LIST_APPEND(&post_deinit_list, &b->list); } /* used to register some per proxy de-initialization functions to call after @@ -148,7 +148,7 @@ void hap_register_proxy_deinit(void (*fct)(struct proxy *)) exit(1); } b->fct = fct; - LIST_ADDQ(&proxy_deinit_list, &b->list); + LIST_APPEND(&proxy_deinit_list, &b->list); } /* used to register some per server de-initialization functions to call after @@ -164,7 +164,7 @@ void hap_register_server_deinit(void (*fct)(struct server *)) exit(1); } b->fct = fct; - LIST_ADDQ(&server_deinit_list, &b->list); + LIST_APPEND(&server_deinit_list, &b->list); } /* used to register some allocation functions to call for each thread. */ @@ -178,7 +178,7 @@ void hap_register_per_thread_alloc(int (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&per_thread_alloc_list, &b->list); + LIST_APPEND(&per_thread_alloc_list, &b->list); } /* used to register some initialization functions to call for each thread. */ @@ -192,7 +192,7 @@ void hap_register_per_thread_init(int (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&per_thread_init_list, &b->list); + LIST_APPEND(&per_thread_init_list, &b->list); } /* used to register some de-initialization functions to call for each thread. */ @@ -206,7 +206,7 @@ void hap_register_per_thread_deinit(void (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&per_thread_deinit_list, &b->list); + LIST_APPEND(&per_thread_deinit_list, &b->list); } /* used to register some free functions to call for each thread. */ @@ -220,5 +220,5 @@ void hap_register_per_thread_free(void (*fct)()) exit(1); } b->fct = fct; - LIST_ADDQ(&per_thread_free_list, &b->list); + LIST_APPEND(&per_thread_free_list, &b->list); } diff --git a/src/listener.c b/src/listener.c index fe0fd24aea..226b6293cd 100644 --- a/src/listener.c +++ b/src/listener.c @@ -353,7 +353,7 @@ void default_add_listener(struct protocol *proto, struct listener *listener) return; listener_set_state(listener, LI_ASSIGNED); listener->rx.proto = proto; - LIST_ADDQ(&proto->receivers, &listener->rx.proto_list); + LIST_APPEND(&proto->receivers, &listener->rx.proto_list); proto->nb_receivers++; } @@ -440,7 +440,7 @@ int pause_listener(struct listener *l) if (l->rx.proto->suspend) ret = l->rx.proto->suspend(l); - MT_LIST_DEL(&l->wait_queue); + MT_LIST_DELETE(&l->wait_queue); listener_set_state(l, LI_PAUSED); @@ -474,7 +474,7 @@ int resume_listener(struct listener *l) /* check that another thread didn't to the job in parallel (e.g. at the * end of listen_accept() while we'd come from dequeue_all_listeners(). */ - if (MT_LIST_ADDED(&l->wait_queue)) + if (MT_LIST_INLIST(&l->wait_queue)) goto end; if ((global.mode & (MODE_DAEMON | MODE_MWORKER)) && @@ -513,7 +513,7 @@ static void listener_full(struct listener *l) { HA_SPIN_LOCK(LISTENER_LOCK, &l->lock); if (l->state >= LI_READY) { - MT_LIST_DEL(&l->wait_queue); + MT_LIST_DELETE(&l->wait_queue); if (l->state != LI_FULL) { l->rx.proto->disable(l); listener_set_state(l, LI_FULL); @@ -529,7 +529,7 @@ static void limit_listener(struct listener *l, struct mt_list *list) { HA_SPIN_LOCK(LISTENER_LOCK, &l->lock); if (l->state == LI_READY) { - MT_LIST_TRY_ADDQ(list, &l->wait_queue); + MT_LIST_TRY_APPEND(list, &l->wait_queue); l->rx.proto->disable(l); listener_set_state(l, LI_LIMITED); } @@ -597,7 +597,7 @@ void default_unbind_listener(struct listener *listener) */ void do_unbind_listener(struct listener *listener) { - MT_LIST_DEL(&listener->wait_queue); + MT_LIST_DELETE(&listener->wait_queue); if (listener->rx.proto->unbind) listener->rx.proto->unbind(listener); @@ -641,8 +641,8 @@ int create_listeners(struct bind_conf *bc, const struct sockaddr_storage *ss, return 0; } l->obj_type = OBJ_TYPE_LISTENER; - LIST_ADDQ(&bc->frontend->conf.listeners, &l->by_fe); - LIST_ADDQ(&bc->listeners, &l->by_bind); + LIST_APPEND(&bc->frontend->conf.listeners, &l->by_fe); + LIST_APPEND(&bc->listeners, &l->by_bind); l->bind_conf = bc; l->rx.settings = &bc->settings; l->rx.owner = l; @@ -681,7 +681,7 @@ void __delete_listener(struct listener *listener) { if (listener->state == LI_ASSIGNED) { listener_set_state(listener, LI_INIT); - LIST_DEL(&listener->rx.proto_list); + LIST_DELETE(&listener->rx.proto_list); listener->rx.proto->nb_receivers--; _HA_ATOMIC_DEC(&jobs); _HA_ATOMIC_DEC(&listeners); @@ -1199,7 +1199,7 @@ struct task *manage_global_listener_queue(struct task *t, void *context, unsigne */ void bind_register_keywords(struct bind_kw_list *kwl) { - LIST_ADDQ(&bind_keywords.list, &kwl->list); + LIST_APPEND(&bind_keywords.list, &kwl->list); } /* Return a pointer to the bind keyword , or NULL if not found. If the diff --git a/src/log.c b/src/log.c index c3437b5cca..fe0e3a2ea8 100644 --- a/src/log.c +++ b/src/log.c @@ -393,7 +393,7 @@ int parse_logformat_var(char *arg, int arg_len, char *var, int var_len, struct p goto error_free; } curproxy->to_log |= logformat_keywords[j].lw; - LIST_ADDQ(list_format, &node->list); + LIST_APPEND(list_format, &node->list); } if (logformat_keywords[j].replace_by) ha_warning("parsing [%s:%d] : deprecated variable '%s' in '%s', please replace it with '%s'.\n", @@ -447,7 +447,7 @@ int add_to_logformat_list(char *start, char *end, int type, struct list *list_fo str[end - start] = '\0'; node->arg = str; node->type = LOG_FMT_TEXT; // type string - LIST_ADDQ(list_format, &node->list); + LIST_APPEND(list_format, &node->list); } else if (type == LF_SEPARATOR) { struct logformat_node *node = calloc(1, sizeof(*node)); if (!node) { @@ -455,7 +455,7 @@ int add_to_logformat_list(char *start, char *end, int type, struct list *list_fo return 0; } node->type = LOG_FMT_SEPARATOR; - LIST_ADDQ(list_format, &node->list); + LIST_APPEND(list_format, &node->list); } return 1; } @@ -528,7 +528,7 @@ int add_sample_to_logformat_list(char *text, char *arg, int arg_len, struct prox curpx->to_log |= LW_XPRT; if (curpx->http_needed) curpx->to_log |= LW_REQ; - LIST_ADDQ(list_format, &node->list); + LIST_APPEND(list_format, &node->list); return 1; error_free: @@ -574,7 +574,7 @@ int parse_logformat_string(const char *fmt, struct proxy *curproxy, struct list /* flush the list first. */ list_for_each_entry_safe(tmplf, back, list_format, list) { - LIST_DEL(&tmplf->list); + LIST_DELETE(&tmplf->list); release_sample_expr(tmplf->expr); free(tmplf->arg); free(tmplf); @@ -831,7 +831,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, const char *file } list_for_each_entry_safe(logsrv, back, logsrvs, list) { - LIST_DEL(&logsrv->list); + LIST_DELETE(&logsrv->list); free(logsrv); } return 1; @@ -858,7 +858,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, const char *file memcpy(node, logsrv, sizeof(struct logsrv)); node->ref = logsrv; LIST_INIT(&node->list); - LIST_ADDQ(logsrvs, &node->list); + LIST_APPEND(logsrvs, &node->list); node->conf.file = strdup(file); node->conf.line = linenum; @@ -1064,7 +1064,7 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, const char *file } done: - LIST_ADDQ(logsrvs, &logsrv->list); + LIST_APPEND(logsrvs, &logsrv->list); return 1; error: diff --git a/src/lru.c b/src/lru.c index 84442a47f2..22f15f7041 100644 --- a/src/lru.c +++ b/src/lru.c @@ -25,8 +25,8 @@ #include /* Minimal list manipulation macros for lru64_list */ -#define LIST_ADD(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); }) -#define LIST_DEL(el) ({ (el)->n->p = (el)->p; (el)->p->n = (el)->n; }) +#define LIST_INSERT(lh, el) ({ (el)->n = (lh)->n; (el)->n->p = (lh)->n = (el); (el)->p = (lh); }) +#define LIST_DELETE(el) ({ (el)->n->p = (el)->p; (el)->p->n = (el)->n; }) /* Lookup key in LRU cache for use with domain whose data's @@ -46,8 +46,8 @@ struct lru64 *lru64_lookup(unsigned long long key, struct lru64_head *lru, * head of the LRU list. */ if (elem->domain == domain && elem->revision == revision) { - LIST_DEL(&elem->lru); - LIST_ADD(&lru->list, &elem->lru); + LIST_DELETE(&elem->lru); + LIST_INSERT(&lru->list, &elem->lru); return elem; } } @@ -87,8 +87,8 @@ struct lru64 *lru64_get(unsigned long long key, struct lru64_head *lru, * head of the LRU list. */ if (elem->domain == domain && elem->revision == revision) { - LIST_DEL(&elem->lru); - LIST_ADD(&lru->list, &elem->lru); + LIST_DELETE(&elem->lru); + LIST_INSERT(&lru->list, &elem->lru); return elem; } @@ -96,7 +96,7 @@ struct lru64 *lru64_get(unsigned long long key, struct lru64_head *lru, return NULL; // currently locked /* recycle this entry */ - LIST_DEL(&elem->lru); + LIST_DELETE(&elem->lru); } else { /* New entry inserted, initialize and move to the head of the @@ -107,7 +107,7 @@ struct lru64 *lru64_get(unsigned long long key, struct lru64_head *lru, } elem->domain = NULL; - LIST_ADD(&lru->list, &elem->lru); + LIST_INSERT(&lru->list, &elem->lru); if (lru->cache_usage > lru->cache_size) { /* try to kill oldest entry */ @@ -116,7 +116,7 @@ struct lru64 *lru64_get(unsigned long long key, struct lru64_head *lru, old = container_of(lru->list.p, typeof(*old), lru); if (old->domain) { /* not locked */ - LIST_DEL(&old->lru); + LIST_DELETE(&old->lru); __eb64_delete(&old->node); if (old->data && old->free) old->free(old->data); @@ -181,7 +181,7 @@ int lru64_destroy(struct lru64_head *lru) next = container_of(elem->lru.p, typeof(*next), lru); if (elem->domain) { /* not locked */ - LIST_DEL(&elem->lru); + LIST_DELETE(&elem->lru); eb64_delete(&elem->node); if (elem->data && elem->free) elem->free(elem->data); @@ -211,7 +211,7 @@ void lru64_kill_oldest(struct lru64_head *lru, unsigned long int nb) if (!elem->domain) continue; /* locked entry */ - LIST_DEL(&elem->lru); + LIST_DELETE(&elem->lru); eb64_delete(&elem->node); if (elem->data && elem->free) elem->free(elem->data); diff --git a/src/mailers.c b/src/mailers.c index e614cf0fc3..80dc7d6f65 100644 --- a/src/mailers.c +++ b/src/mailers.c @@ -46,7 +46,7 @@ void email_alert_free(struct email_alert *alert) if (alert->rules.list) { list_for_each_entry_safe(rule, back, alert->rules.list, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); free_tcpcheck(rule, 1); } free_tcpcheck_vars(&alert->rules.preset_vars); @@ -74,7 +74,7 @@ static struct task *process_email_alert(struct task *t, void *context, unsigned } alert = LIST_NEXT(&q->email_alerts, typeof(alert), list); - LIST_DEL(&alert->list); + LIST_DELETE(&alert->list); t->expire = now_ms; check->tcpcheck_rules = &alert->rules; check->status = HCHK_STATUS_INI; @@ -189,7 +189,7 @@ static int enqueue_one_email_alert(struct proxy *p, struct server *s, tcpcheck->action = TCPCHK_ACT_CONNECT; tcpcheck->comment = NULL; - LIST_ADDQ(alert->rules.list, &tcpcheck->list); + LIST_APPEND(alert->rules.list, &tcpcheck->list); if (!add_tcpcheck_expect_str(&alert->rules, "220 ")) goto error; @@ -269,7 +269,7 @@ static int enqueue_one_email_alert(struct proxy *p, struct server *s, HA_SPIN_LOCK(EMAIL_ALERTS_LOCK, &q->lock); task_wakeup(check->task, TASK_WOKEN_MSG); - LIST_ADDQ(&q->email_alerts, &alert->list); + LIST_APPEND(&q->email_alerts, &alert->list); HA_SPIN_UNLOCK(EMAIL_ALERTS_LOCK, &q->lock); return 1; diff --git a/src/map.c b/src/map.c index 6b5502e8a6..041c339f44 100644 --- a/src/map.c +++ b/src/map.c @@ -330,7 +330,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx) */ if (appctx->st2 == STAT_ST_LIST) { if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) { - LIST_DEL(&appctx->ctx.map.bref.users); + LIST_DELETE(&appctx->ctx.map.bref.users); LIST_INIT(&appctx->ctx.map.bref.users); } } @@ -359,7 +359,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx) HA_SPIN_LOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock); if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) { - LIST_DEL(&appctx->ctx.map.bref.users); + LIST_DELETE(&appctx->ctx.map.bref.users); LIST_INIT(&appctx->ctx.map.bref.users); } @@ -384,7 +384,7 @@ static int cli_io_handler_pat_list(struct appctx *appctx) /* let's try again later from this stream. We add ourselves into * this stream's users so that it can remove us upon termination. */ - LIST_ADDQ(&elt->back_refs, &appctx->ctx.map.bref.users); + LIST_APPEND(&elt->back_refs, &appctx->ctx.map.bref.users); HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock); si_rx_room_blk(si); return 0; @@ -635,7 +635,7 @@ static void cli_release_show_map(struct appctx *appctx) if (appctx->st2 == STAT_ST_LIST) { HA_SPIN_LOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock); if (!LIST_ISEMPTY(&appctx->ctx.map.bref.users)) - LIST_DEL(&appctx->ctx.map.bref.users); + LIST_DELETE(&appctx->ctx.map.bref.users); HA_SPIN_UNLOCK(PATREF_LOCK, &appctx->ctx.map.ref->lock); } } diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c index f938a570e7..075a576de3 100644 --- a/src/mux_fcgi.c +++ b/src/mux_fcgi.c @@ -604,11 +604,11 @@ static inline struct buffer *fcgi_get_buf(struct fcgi_conn *fconn, struct buffer { struct buffer *buf = NULL; - if (likely(!LIST_ADDED(&fconn->buf_wait.list)) && + if (likely(!LIST_INLIST(&fconn->buf_wait.list)) && unlikely((buf = b_alloc(bptr)) == NULL)) { fconn->buf_wait.target = fconn; fconn->buf_wait.wakeup_cb = fcgi_buf_available; - LIST_ADDQ(&ti->buffer_wq, &fconn->buf_wait.list); + LIST_APPEND(&ti->buffer_wq, &fconn->buf_wait.list); } return buf; } @@ -845,7 +845,7 @@ static void fcgi_release(struct fcgi_conn *fconn) TRACE_DEVEL("freeing fconn", FCGI_EV_FCONN_END, conn); - if (LIST_ADDED(&fconn->buf_wait.list)) + if (LIST_INLIST(&fconn->buf_wait.list)) LIST_DEL_INIT(&fconn->buf_wait.list); fcgi_release_buf(fconn, &fconn->dbuf); @@ -3641,7 +3641,7 @@ static void fcgi_detach(struct conn_stream *cs) } else if (!fconn->conn->hash_node->node.node.leaf_p && fcgi_avail_streams(fconn->conn) > 0 && objt_server(fconn->conn->target) && - !LIST_ADDED(&fconn->conn->session_list)) { + !LIST_INLIST(&fconn->conn->session_list)) { ebmb_insert(&__objt_server(fconn->conn->target)->per_thr[tid].avail_conns, &fconn->conn->hash_node->node, sizeof(fconn->conn->hash_node->hash)); @@ -3708,9 +3708,9 @@ static void fcgi_do_shutr(struct fcgi_strm *fstrm) * automatically called via the shut_tl tasklet when there's room * again. */ - if (!LIST_ADDED(&fstrm->send_list)) { + if (!LIST_INLIST(&fstrm->send_list)) { if (fstrm->flags & (FCGI_SF_BLK_MBUSY|FCGI_SF_BLK_MROOM)) { - LIST_ADDQ(&fconn->send_list, &fstrm->send_list); + LIST_APPEND(&fconn->send_list, &fstrm->send_list); } } fstrm->flags |= FCGI_SF_WANT_SHUTR; @@ -3764,9 +3764,9 @@ static void fcgi_do_shutw(struct fcgi_strm *fstrm) * automatically called via the shut_tl tasklet when there's room * again. */ - if (!LIST_ADDED(&fstrm->send_list)) { + if (!LIST_INLIST(&fstrm->send_list)) { if (fstrm->flags & (FCGI_SF_BLK_MBUSY|FCGI_SF_BLK_MROOM)) { - LIST_ADDQ(&fconn->send_list, &fstrm->send_list); + LIST_APPEND(&fconn->send_list, &fstrm->send_list); } } fstrm->flags |= FCGI_SF_WANT_SHUTW; @@ -3859,8 +3859,8 @@ static int fcgi_subscribe(struct conn_stream *cs, int event_type, struct wait_ev if (event_type & SUB_RETRY_SEND) { TRACE_DEVEL("unsubscribe(send)", FCGI_EV_STRM_SEND, fconn->conn, fstrm); - if (!LIST_ADDED(&fstrm->send_list)) - LIST_ADDQ(&fconn->send_list, &fstrm->send_list); + if (!LIST_INLIST(&fstrm->send_list)) + LIST_APPEND(&fconn->send_list, &fstrm->send_list); } return 0; } diff --git a/src/mux_h1.c b/src/mux_h1.c index aa885b8aad..e8a7d6b7a3 100644 --- a/src/mux_h1.c +++ b/src/mux_h1.c @@ -448,11 +448,11 @@ static inline struct buffer *h1_get_buf(struct h1c *h1c, struct buffer *bptr) { struct buffer *buf = NULL; - if (likely(!LIST_ADDED(&h1c->buf_wait.list)) && + if (likely(!LIST_INLIST(&h1c->buf_wait.list)) && unlikely((buf = b_alloc(bptr)) == NULL)) { h1c->buf_wait.target = h1c; h1c->buf_wait.wakeup_cb = h1_buf_available; - LIST_ADDQ(&ti->buffer_wq, &h1c->buf_wait.list); + LIST_APPEND(&ti->buffer_wq, &h1c->buf_wait.list); } return buf; } @@ -913,7 +913,7 @@ static void h1_release(struct h1c *h1c) } - if (LIST_ADDED(&h1c->buf_wait.list)) + if (LIST_INLIST(&h1c->buf_wait.list)) LIST_DEL_INIT(&h1c->buf_wait.list); h1_release_buf(h1c, &h1c->ibuf); diff --git a/src/mux_h2.c b/src/mux_h2.c index 7d2c64e388..ac8071960d 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -806,11 +806,11 @@ static inline struct buffer *h2_get_buf(struct h2c *h2c, struct buffer *bptr) { struct buffer *buf = NULL; - if (likely(!LIST_ADDED(&h2c->buf_wait.list)) && + if (likely(!LIST_INLIST(&h2c->buf_wait.list)) && unlikely((buf = b_alloc(bptr)) == NULL)) { h2c->buf_wait.target = h2c; h2c->buf_wait.wakeup_cb = h2_buf_available; - LIST_ADDQ(&ti->buffer_wq, &h2c->buf_wait.list); + LIST_APPEND(&ti->buffer_wq, &h2c->buf_wait.list); } return buf; } @@ -1074,7 +1074,7 @@ static void h2_release(struct h2c *h2c) TRACE_DEVEL("freeing h2c", H2_EV_H2C_END, conn); hpack_dht_free(h2c->ddht); - if (LIST_ADDED(&h2c->buf_wait.list)) + if (LIST_INLIST(&h2c->buf_wait.list)) LIST_DEL_INIT(&h2c->buf_wait.list); h2_release_buf(h2c, &h2c->dbuf); @@ -2125,7 +2125,7 @@ static void h2c_unblock_sfctl(struct h2c *h2c) LIST_DEL_INIT(&h2s->list); if ((h2s->subs && h2s->subs->events & SUB_RETRY_SEND) || h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW)) - LIST_ADDQ(&h2c->send_list, &h2s->list); + LIST_APPEND(&h2c->send_list, &h2s->list); } node = eb32_next(node); } @@ -2478,7 +2478,7 @@ static int h2c_handle_window_update(struct h2c *h2c, struct h2s *h2s) LIST_DEL_INIT(&h2s->list); if ((h2s->subs && h2s->subs->events & SUB_RETRY_SEND) || h2s->flags & (H2_SF_WANT_SHUTR|H2_SF_WANT_SHUTW)) - LIST_ADDQ(&h2c->send_list, &h2s->list); + LIST_APPEND(&h2c->send_list, &h2s->list); } } else { @@ -4274,7 +4274,7 @@ static void h2_detach(struct conn_stream *cs) } else if (!h2c->conn->hash_node->node.node.leaf_p && h2_avail_streams(h2c->conn) > 0 && objt_server(h2c->conn->target) && - !LIST_ADDED(&h2c->conn->session_list)) { + !LIST_INLIST(&h2c->conn->session_list)) { ebmb_insert(&__objt_server(h2c->conn->target)->per_thr[tid].avail_conns, &h2c->conn->hash_node->node, sizeof(h2c->conn->hash_node->hash)); @@ -4361,11 +4361,11 @@ static void h2_do_shutr(struct h2s *h2s) * again. */ h2s->flags |= H2_SF_WANT_SHUTR; - if (!LIST_ADDED(&h2s->list)) { + if (!LIST_INLIST(&h2s->list)) { if (h2s->flags & H2_SF_BLK_MFCTL) - LIST_ADDQ(&h2c->fctl_list, &h2s->list); + LIST_APPEND(&h2c->fctl_list, &h2s->list); else if (h2s->flags & (H2_SF_BLK_MBUSY|H2_SF_BLK_MROOM)) - LIST_ADDQ(&h2c->send_list, &h2s->list); + LIST_APPEND(&h2c->send_list, &h2s->list); } TRACE_LEAVE(H2_EV_STRM_SHUT, h2c->conn, h2s); return; @@ -4436,11 +4436,11 @@ static void h2_do_shutw(struct h2s *h2s) * again. */ h2s->flags |= H2_SF_WANT_SHUTW; - if (!LIST_ADDED(&h2s->list)) { + if (!LIST_INLIST(&h2s->list)) { if (h2s->flags & H2_SF_BLK_MFCTL) - LIST_ADDQ(&h2c->fctl_list, &h2s->list); + LIST_APPEND(&h2c->fctl_list, &h2s->list); else if (h2s->flags & (H2_SF_BLK_MBUSY|H2_SF_BLK_MROOM)) - LIST_ADDQ(&h2c->send_list, &h2s->list); + LIST_APPEND(&h2c->send_list, &h2s->list); } TRACE_LEAVE(H2_EV_STRM_SHUT, h2c->conn, h2s); return; @@ -5765,9 +5765,9 @@ static size_t h2s_make_data(struct h2s *h2s, struct buffer *buf, size_t count) if (h2s_mws(h2s) <= 0) { h2s->flags |= H2_SF_BLK_SFCTL; - if (LIST_ADDED(&h2s->list)) + if (LIST_INLIST(&h2s->list)) LIST_DEL_INIT(&h2s->list); - LIST_ADDQ(&h2c->blocked_list, &h2s->list); + LIST_APPEND(&h2c->blocked_list, &h2s->list); TRACE_STATE("stream window <=0, flow-controlled", H2_EV_TX_FRAME|H2_EV_TX_DATA|H2_EV_H2S_FCTL, h2c->conn, h2s); goto end; } @@ -6151,11 +6151,11 @@ static int h2_subscribe(struct conn_stream *cs, int event_type, struct wait_even if (event_type & SUB_RETRY_SEND) { TRACE_DEVEL("subscribe(send)", H2_EV_STRM_SEND, h2c->conn, h2s); if (!(h2s->flags & H2_SF_BLK_SFCTL) && - !LIST_ADDED(&h2s->list)) { + !LIST_INLIST(&h2s->list)) { if (h2s->flags & H2_SF_BLK_MFCTL) - LIST_ADDQ(&h2c->fctl_list, &h2s->list); + LIST_APPEND(&h2c->fctl_list, &h2s->list); else - LIST_ADDQ(&h2c->send_list, &h2s->list); + LIST_APPEND(&h2c->send_list, &h2s->list); } } TRACE_LEAVE(H2_EV_STRM_SEND|H2_EV_STRM_RECV, h2c->conn, h2s); diff --git a/src/mworker-prog.c b/src/mworker-prog.c index 4113b7c560..8d9ce3aab4 100644 --- a/src/mworker-prog.c +++ b/src/mworker-prog.c @@ -70,7 +70,7 @@ int mworker_ext_launch_all() } - LIST_DEL(&child->list); + LIST_DELETE(&child->list); mworker_free_child(child); child = NULL; @@ -183,7 +183,7 @@ int cfg_parse_program(const char *file, int linenum, char **args, int kwm) goto error; } - LIST_ADDQ(&proc_list, &ext_child->list); + LIST_APPEND(&proc_list, &ext_child->list); } else if (strcmp(args[0], "command") == 0) { int arg_nb = 0; @@ -302,7 +302,7 @@ int cfg_parse_program(const char *file, int linenum, char **args, int kwm) error: if (ext_child) { - LIST_DEL(&ext_child->list); + LIST_DELETE(&ext_child->list); if (ext_child->command) { int i; diff --git a/src/mworker.c b/src/mworker.c index afcada6f99..e3c579b571 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -184,7 +184,7 @@ void mworker_env_to_proc_list() /* this is a process inherited from a reload that should be leaving */ child->options |= PROC_O_LEAVING; - LIST_ADDQ(&proc_list, &child->list); + LIST_APPEND(&proc_list, &child->list); } else { mworker_free_child(child); } @@ -276,7 +276,7 @@ void mworker_catch_sigchld(struct sig_handler *sh) if (child->pid != exitpid) continue; - LIST_DEL(&child->list); + LIST_DELETE(&child->list); close(child->ipc_fd[0]); childfound = 1; break; diff --git a/src/pattern.c b/src/pattern.c index 252bd35d1f..80ff0259b3 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -1163,7 +1163,7 @@ void pat_prune_gen(struct pattern_expr *expr) struct pattern_list *pat, *tmp; list_for_each_entry_safe(pat, tmp, &expr->patterns, list) { - LIST_DEL(&pat->list); + LIST_DELETE(&pat->list); pat_unlink_from_head(&pat->pat.ref->list_head, &pat->from_ref); if (pat->pat.sflags & PAT_SF_REGFREE) regex_free(pat->pat.ptr.ptr); @@ -1200,7 +1200,7 @@ int pat_idx_list_val(struct pattern_expr *expr, struct pattern *pat, char **err) memcpy(&patl->pat, pat, sizeof(*pat)); /* chain pattern in the expression */ - LIST_ADDQ(&expr->patterns, &patl->list); + LIST_APPEND(&expr->patterns, &patl->list); /* and from the reference */ patl->from_ref = pat->ref->list_head; pat->ref->list_head = &patl->from_ref; @@ -1232,7 +1232,7 @@ int pat_idx_list_ptr(struct pattern_expr *expr, struct pattern *pat, char **err) memcpy(patl->pat.ptr.ptr, pat->ptr.ptr, pat->len); /* chain pattern in the expression */ - LIST_ADDQ(&expr->patterns, &patl->list); + LIST_APPEND(&expr->patterns, &patl->list); /* and from the reference */ patl->from_ref = pat->ref->list_head; pat->ref->list_head = &patl->from_ref; @@ -1265,7 +1265,7 @@ int pat_idx_list_str(struct pattern_expr *expr, struct pattern *pat, char **err) patl->pat.ptr.str[patl->pat.len] = '\0'; /* chain pattern in the expression */ - LIST_ADDQ(&expr->patterns, &patl->list); + LIST_APPEND(&expr->patterns, &patl->list); /* and from the reference */ patl->from_ref = pat->ref->list_head; pat->ref->list_head = &patl->from_ref; @@ -1298,7 +1298,7 @@ int pat_idx_list_reg_cap(struct pattern_expr *expr, struct pattern *pat, int cap } /* chain pattern in the expression */ - LIST_ADDQ(&expr->patterns, &patl->list); + LIST_APPEND(&expr->patterns, &patl->list); /* and from the reference */ patl->from_ref = pat->ref->list_head; pat->ref->list_head = &patl->from_ref; @@ -1506,7 +1506,7 @@ void pat_delete_gen(struct pat_ref *ref, struct pat_ref_elt *elt) BUG_ON(pat->pat.ref != elt); /* Delete and free entry. */ - LIST_DEL(&pat->list); + LIST_DELETE(&pat->list); if (pat->pat.sflags & PAT_SF_REGFREE) regex_free(pat->pat.ptr.reg); else @@ -1597,10 +1597,10 @@ void pat_ref_delete_by_ptr(struct pat_ref *ref, struct pat_ref_elt *elt) * not relink them if this elt was the last one in the list. */ list_for_each_entry_safe(bref, back, &elt->back_refs, users) { - LIST_DEL(&bref->users); + LIST_DELETE(&bref->users); LIST_INIT(&bref->users); if (elt->list.n != &ref->head) - LIST_ADDQ(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users); + LIST_APPEND(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users); bref->ref = elt->list.n; } @@ -1613,7 +1613,7 @@ void pat_ref_delete_by_ptr(struct pat_ref *ref, struct pat_ref_elt *elt) list_for_each_entry(expr, &ref->pat, list) HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &expr->lock); - LIST_DEL(&elt->list); + LIST_DELETE(&elt->list); free(elt->sample); free(elt->pattern); free(elt); @@ -1823,7 +1823,7 @@ struct pat_ref *pat_ref_new(const char *reference, const char *display, unsigned LIST_INIT(&ref->head); LIST_INIT(&ref->pat); HA_SPIN_INIT(&ref->lock); - LIST_ADDQ(&pattern_reference, &ref->list); + LIST_APPEND(&pattern_reference, &ref->list); return ref; } @@ -1859,7 +1859,7 @@ struct pat_ref *pat_ref_newid(int unique_id, const char *display, unsigned int f LIST_INIT(&ref->head); LIST_INIT(&ref->pat); HA_SPIN_INIT(&ref->lock); - LIST_ADDQ(&pattern_reference, &ref->list); + LIST_APPEND(&pattern_reference, &ref->list); return ref; } @@ -1893,7 +1893,7 @@ struct pat_ref_elt *pat_ref_append(struct pat_ref *ref, const char *pattern, con LIST_INIT(&elt->back_refs); elt->list_head = NULL; elt->tree_head = NULL; - LIST_ADDQ(&ref->head, &elt->list); + LIST_APPEND(&ref->head, &elt->list); return elt; fail: if (elt) @@ -2052,17 +2052,17 @@ int pat_ref_purge_older(struct pat_ref *ref, unsigned int oldest, int budget) * not relink them if this elt was the last one in the list. */ list_for_each_entry_safe(bref, bref_bck, &elt->back_refs, users) { - LIST_DEL(&bref->users); + LIST_DELETE(&bref->users); LIST_INIT(&bref->users); if (elt->list.n != &ref->head) - LIST_ADDQ(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users); + LIST_APPEND(&LIST_ELEM(elt->list.n, typeof(elt), list)->back_refs, &bref->users); bref->ref = elt->list.n; } /* delete the storage for all representations of this pattern. */ pat_delete_gen(ref, elt); - LIST_DEL(&elt->list); + LIST_DELETE(&elt->list); free(elt->pattern); free(elt->sample); free(elt); @@ -2107,15 +2107,15 @@ void pat_ref_reload(struct pat_ref *ref, struct pat_ref *replace) bref->ref = NULL; } pat_delete_gen(ref, elt); - LIST_DEL(&elt->list); + LIST_DELETE(&elt->list); free(elt->pattern); free(elt->sample); free(elt); } /* switch pat_ret_elt lists */ - LIST_ADD(&replace->head, &ref->head); - LIST_DEL(&replace->head); + LIST_INSERT(&replace->head, &ref->head); + LIST_DELETE(&replace->head); list_for_each_entry(expr, &ref->pat, list) { list_for_each_entry(elt, &ref->head, list) { @@ -2255,9 +2255,9 @@ struct pattern_expr *pattern_new_expr(struct pattern_head *head, struct pat_ref /* This new pattern expression reference one of his heads. */ expr->pat_head = head; - /* Link with ref, or to self to facilitate LIST_DEL() */ + /* Link with ref, or to self to facilitate LIST_DELETE() */ if (ref) - LIST_ADDQ(&ref->pat, &expr->list); + LIST_APPEND(&ref->pat, &expr->list); else LIST_INIT(&expr->list); @@ -2281,7 +2281,7 @@ struct pattern_expr *pattern_new_expr(struct pattern_head *head, struct pat_ref list->expr = expr; /* Link the list element with the pattern_head. */ - LIST_ADDQ(&head->head, &list->list); + LIST_APPEND(&head->head, &list->list); return expr; } @@ -2637,9 +2637,9 @@ void pattern_prune(struct pattern_head *head) struct pattern_expr_list *list, *safe; list_for_each_entry_safe(list, safe, &head->head, list) { - LIST_DEL(&list->list); + LIST_DELETE(&list->list); if (list->do_free) { - LIST_DEL(&list->expr->list); + LIST_DELETE(&list->expr->list); HA_RWLOCK_WRLOCK(PATEXP_LOCK, &list->expr->lock); head->prune(list->expr); HA_RWLOCK_WRUNLOCK(PATEXP_LOCK, &list->expr->lock); @@ -2754,11 +2754,11 @@ int pattern_finalize_config(void) /* Convert back to linked list */ for (i = 0; i < len; i++) - LIST_ADDQ(&pr, &arr[i]->list); + LIST_APPEND(&pr, &arr[i]->list); /* swap root */ - LIST_ADD(&pr, &pattern_reference); - LIST_DEL(&pr); + LIST_INSERT(&pr, &pattern_reference); + LIST_DELETE(&pr); free(arr); return 0; diff --git a/src/peers.c b/src/peers.c index 2ebb107dfb..b7ea415d1f 100644 --- a/src/peers.c +++ b/src/peers.c @@ -2858,7 +2858,7 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer /* Error unrolling */ out_free_strm: - LIST_DEL(&s->list); + LIST_DELETE(&s->list); pool_free(pool_head_stream, s); out_free_sess: session_free(sess); diff --git a/src/pool.c b/src/pool.c index 70095021ad..2233750623 100644 --- a/src/pool.c +++ b/src/pool.c @@ -104,7 +104,7 @@ struct pool_head *create_pool(char *name, unsigned int size, unsigned int flags) strlcpy2(pool->name, name, sizeof(pool->name)); pool->size = size; pool->flags = flags; - LIST_ADDQ(start, &pool->list); + LIST_APPEND(start, &pool->list); #ifdef CONFIG_HAP_POOLS /* update per-thread pool cache if necessary */ @@ -202,8 +202,8 @@ void pool_evict_from_local_cache(struct pool_head *pool) ph->count--; pool_cache_bytes -= pool->size; pool_cache_count--; - LIST_DEL(&item->by_pool); - LIST_DEL(&item->by_lru); + LIST_DELETE(&item->by_pool); + LIST_DELETE(&item->by_lru); pool_put_to_shared_cache(pool, item); } } @@ -224,8 +224,8 @@ void pool_evict_from_local_caches() */ ph = LIST_NEXT(&item->by_pool, struct pool_cache_head *, list); pool = container_of(ph - tid, struct pool_head, cache); - LIST_DEL(&item->by_pool); - LIST_DEL(&item->by_lru); + LIST_DELETE(&item->by_pool); + LIST_DELETE(&item->by_lru); ph->count--; pool_cache_count--; pool_cache_bytes -= pool->size; @@ -243,8 +243,8 @@ void pool_put_to_cache(struct pool_head *pool, void *ptr) struct pool_cache_item *item = (struct pool_cache_item *)ptr; struct pool_cache_head *ph = &pool->cache[tid]; - LIST_ADD(&ph->list, &item->by_pool); - LIST_ADD(&ti->pool_lru_head, &item->by_lru); + LIST_INSERT(&ph->list, &item->by_pool); + LIST_INSERT(&ti->pool_lru_head, &item->by_lru); ph->count++; pool_cache_count++; pool_cache_bytes += pool->size; @@ -429,7 +429,7 @@ void *pool_destroy(struct pool_head *pool) return pool; pool->users--; if (!pool->users) { - LIST_DEL(&pool->list); + LIST_DELETE(&pool->list); #ifndef CONFIG_HAP_LOCKLESS_POOLS HA_SPIN_DESTROY(&pool->lock); #endif diff --git a/src/protocol.c b/src/protocol.c index cd574f2b25..767e03a240 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -36,7 +36,7 @@ __decl_spinlock(proto_lock); void protocol_register(struct protocol *proto) { HA_SPIN_LOCK(PROTO_LOCK, &proto_lock); - LIST_ADDQ(&protocols, &proto->list); + LIST_APPEND(&protocols, &proto->list); if (proto->fam->sock_domain >= 0 && proto->fam->sock_domain < AF_CUST_MAX) __protocol_by_family[proto->fam->sock_domain] [proto->sock_type == SOCK_DGRAM] @@ -50,7 +50,7 @@ void protocol_register(struct protocol *proto) void protocol_unregister(struct protocol *proto) { HA_SPIN_LOCK(PROTO_LOCK, &proto_lock); - LIST_DEL(&proto->list); + LIST_DELETE(&proto->list); LIST_INIT(&proto->list); HA_SPIN_UNLOCK(PROTO_LOCK, &proto_lock); } diff --git a/src/proxy.c b/src/proxy.c index 80eba92ae9..c3859e6056 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -121,7 +121,7 @@ static void free_stick_rules(struct list *rules) struct sticking_rule *rule, *ruleb; list_for_each_entry_safe(rule, ruleb, rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); free_acl_cond(rule->cond); release_sample_expr(rule->expr); free(rule); @@ -176,7 +176,7 @@ void free_proxy(struct proxy *p) free(p->conf.lfsd_file); list_for_each_entry_safe(cond, condb, &p->mon_fail_cond, list) { - LIST_DEL(&cond->list); + LIST_DELETE(&cond->list); prune_acl_cond(cond); free(cond); } @@ -185,16 +185,16 @@ void free_proxy(struct proxy *p) EXTRA_COUNTERS_FREE(p->extra_counters_be); list_for_each_entry_safe(acl, aclb, &p->acl, list) { - LIST_DEL(&acl->list); + LIST_DELETE(&acl->list); prune_acl(acl); free(acl); } list_for_each_entry_safe(srule, sruleb, &p->server_rules, list) { - LIST_DEL(&srule->list); + LIST_DELETE(&srule->list); prune_acl_cond(srule->cond); list_for_each_entry_safe(lf, lfb, &srule->expr, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -205,7 +205,7 @@ void free_proxy(struct proxy *p) } list_for_each_entry_safe(rule, ruleb, &p->switching_rules, list) { - LIST_DEL(&rule->list); + LIST_DELETE(&rule->list); if (rule->cond) { prune_acl_cond(rule->cond); free(rule->cond); @@ -215,40 +215,40 @@ void free_proxy(struct proxy *p) } list_for_each_entry_safe(rdr, rdrb, &p->redirect_rules, list) { - LIST_DEL(&rdr->list); + LIST_DELETE(&rdr->list); if (rdr->cond) { prune_acl_cond(rdr->cond); free(rdr->cond); } free(rdr->rdr_str); list_for_each_entry_safe(lf, lfb, &rdr->rdr_fmt, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); free(lf); } free(rdr); } list_for_each_entry_safe(log, logb, &p->logsrvs, list) { - LIST_DEL(&log->list); + LIST_DELETE(&log->list); free(log); } list_for_each_entry_safe(lf, lfb, &p->logformat, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); } list_for_each_entry_safe(lf, lfb, &p->logformat_sd, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); } list_for_each_entry_safe(lf, lfb, &p->format_unique_id, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -293,8 +293,8 @@ void free_proxy(struct proxy *p) }/* end while(s) */ list_for_each_entry_safe(l, l_next, &p->conf.listeners, by_fe) { - LIST_DEL(&l->by_fe); - LIST_DEL(&l->by_bind); + LIST_DELETE(&l->by_fe); + LIST_DELETE(&l->by_bind); free(l->name); free(l->counters); @@ -308,7 +308,7 @@ void free_proxy(struct proxy *p) bind_conf->xprt->destroy_bind_conf(bind_conf); free(bind_conf->file); free(bind_conf->arg); - LIST_DEL(&bind_conf->by_fe); + LIST_DELETE(&bind_conf->by_fe); free(bind_conf); } @@ -1684,7 +1684,7 @@ static int proxy_defproxy_cpy(struct proxy *curproxy, const struct proxy *defpro memcpy(node, tmplogsrv, sizeof(struct logsrv)); node->ref = tmplogsrv->ref; LIST_INIT(&node->list); - LIST_ADDQ(&curproxy->logsrvs, &node->list); + LIST_APPEND(&curproxy->logsrvs, &node->list); } curproxy->conf.uniqueid_format_string = defproxy->conf.uniqueid_format_string; diff --git a/src/quic_sock.c b/src/quic_sock.c index 8ded828903..82d627067b 100644 --- a/src/quic_sock.c +++ b/src/quic_sock.c @@ -151,7 +151,7 @@ struct connection *quic_sock_accept_conn(struct listener *l, int *status) goto err; qc = pkt->qc; - LIST_DEL(&pkt->rx_list); + LIST_DELETE(&pkt->rx_list); if (!new_quic_cli_conn(qc, l, &pkt->saddr)) goto err; diff --git a/src/resolvers.c b/src/resolvers.c index 1ba5d66041..88e8d7600a 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -210,7 +210,7 @@ struct resolv_srvrq *new_resolv_srvrq(struct server *srv, char *fqdn) proxy_type_str(px), px->id, srv->id); goto err; } - LIST_ADDQ(&resolv_srvrq_list, &srvrq->list); + LIST_APPEND(&resolv_srvrq_list, &srvrq->list); return srvrq; err: @@ -378,8 +378,8 @@ static int resolv_send_query(struct resolv_resolution *resolution) } /* Push the resolution at the end of the active list */ - LIST_DEL(&resolution->list); - LIST_ADDQ(&resolvers->resolutions.curr, &resolution->list); + LIST_DELETE(&resolution->list); + LIST_APPEND(&resolvers->resolutions.curr, &resolution->list); return 0; } @@ -617,7 +617,7 @@ static void resolv_check_response(struct resolv_resolution *res) } rm_obselete_item: - LIST_DEL(&item->list); + LIST_DELETE(&item->list); if (item->ar_item) { pool_free(resolv_answer_item_pool, item->ar_item); item->ar_item = NULL; @@ -854,7 +854,7 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe if (query_record_id > DNS_MAX_QUERY_RECORDS) goto invalid_resp; query = &resolution->response_query_records[query_record_id]; - LIST_ADDQ(&r_res->query_list, &query->list); + LIST_APPEND(&r_res->query_list, &query->list); /* Name is a NULL terminated string in our case, since we have * one query per response and the first one can't be compressed @@ -1103,7 +1103,7 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe else { answer_record->last_seen = now_ms; answer_record->ar_item = NULL; - LIST_ADDQ(&r_res->answer_list, &answer_record->list); + LIST_APPEND(&r_res->answer_list, &answer_record->list); answer_record = NULL; } } /* for i 0 to ancount */ @@ -1496,8 +1496,8 @@ int resolv_get_ip_from_response(struct resolv_response *r_res, list_for_each_entry(record, &r_res->answer_list, list) { /* Move the first record to the end of the list, for internal * round robin */ - LIST_DEL(&record->list); - LIST_ADDQ(&r_res->answer_list, &record->list); + LIST_DELETE(&record->list); + LIST_APPEND(&r_res->answer_list, &record->list); break; } return RSLV_UPD_SRVIP_NOT_FOUND; @@ -1678,7 +1678,7 @@ static struct resolv_resolution *resolv_pick_resolution(struct resolvers *resolv ++resolution_uuid; /* Move the resolution to the resolvers wait queue */ - LIST_ADDQ(&resolvers->resolutions.wait, &res->list); + LIST_APPEND(&resolvers->resolutions.wait, &res->list); } return res; } @@ -1688,7 +1688,7 @@ void resolv_purge_resolution_answer_records(struct resolv_resolution *resolution struct resolv_answer_item *item, *itemback; list_for_each_entry_safe(item, itemback, &resolution->response.answer_list, list) { - LIST_DEL(&item->list); + LIST_DELETE(&item->list); pool_free(resolv_answer_item_pool, item->ar_item); pool_free(resolv_answer_item_pool, item); } @@ -1705,11 +1705,11 @@ static void resolv_free_resolution(struct resolv_resolution *resolution) resolution->hostname_dn_len = 0; list_for_each_entry_safe(req, reqback, &resolution->requesters, list) { - LIST_DEL(&req->list); + LIST_DELETE(&req->list); req->resolution = NULL; } resolv_purge_resolution_answer_records(resolution); - LIST_DEL(&resolution->list); + LIST_DELETE(&resolution->list); pool_free(resolv_resolution_pool, resolution); } @@ -1814,7 +1814,7 @@ int resolv_link_resolution(void *requester, int requester_type, int requester_lo req->resolution = res; - LIST_ADDQ(&res->requesters, &req->list); + LIST_APPEND(&res->requesters, &req->list); return 0; err: @@ -1838,7 +1838,7 @@ void resolv_unlink_resolution(struct resolv_requester *requester, int safe) res = requester->resolution; /* Clean up the requester */ - LIST_DEL(&requester->list); + LIST_DELETE(&requester->list); requester->resolution = NULL; /* We need to find another requester linked on this resolution */ @@ -2036,8 +2036,8 @@ static int resolv_process_responses(struct dns_nameserver *ns) list_for_each_entry(req, &res->requesters, list) req->requester_error_cb(req, dns_resp); resolv_reset_resolution(res); - LIST_DEL(&res->list); - LIST_ADDQ(&resolvers->resolutions.wait, &res->list); + LIST_DELETE(&res->list); + LIST_APPEND(&resolvers->resolutions.wait, &res->list); continue; report_res_success: @@ -2056,8 +2056,8 @@ static int resolv_process_responses(struct dns_nameserver *ns) } resolv_reset_resolution(res); - LIST_DEL(&res->list); - LIST_ADDQ(&resolvers->resolutions.wait, &res->list); + LIST_DELETE(&res->list); + LIST_APPEND(&resolvers->resolutions.wait, &res->list); continue; } resolv_update_resolvers_timeout(resolvers); @@ -2106,8 +2106,8 @@ static struct task *process_resolvers(struct task *t, void *context, unsigned in /* Clean up resolution info and remove it from the * current list */ resolv_reset_resolution(res); - LIST_DEL(&res->list); - LIST_ADDQ(&resolvers->resolutions.wait, &res->list); + LIST_DELETE(&res->list); + LIST_APPEND(&resolvers->resolutions.wait, &res->list); } else { /* Otherwise resend the DNS query and requeue the resolution */ @@ -2144,8 +2144,8 @@ static struct task *process_resolvers(struct task *t, void *context, unsigned in if (resolv_run_resolution(res) != 1) { res->last_resolution = now_ms; - LIST_DEL(&res->list); - LIST_ADDQ(&resolvers->resolutions.wait, &res->list); + LIST_DELETE(&res->list); + LIST_APPEND(&resolvers->resolutions.wait, &res->list); } } @@ -2185,14 +2185,14 @@ static void resolvers_deinit(void) task_destroy(ns->stream->task_rsp); free(ns->stream); } - LIST_DEL(&ns->list); + LIST_DELETE(&ns->list); EXTRA_COUNTERS_FREE(ns->extra_counters); free(ns); } list_for_each_entry_safe(res, resback, &resolvers->resolutions.curr, list) { list_for_each_entry_safe(req, reqback, &res->requesters, list) { - LIST_DEL(&req->list); + LIST_DELETE(&req->list); pool_free(resolv_requester_pool, req); } resolv_free_resolution(res); @@ -2200,7 +2200,7 @@ static void resolvers_deinit(void) list_for_each_entry_safe(res, resback, &resolvers->resolutions.wait, list) { list_for_each_entry_safe(req, reqback, &res->requesters, list) { - LIST_DEL(&req->list); + LIST_DELETE(&req->list); pool_free(resolv_requester_pool, req); } resolv_free_resolution(res); @@ -2209,14 +2209,14 @@ static void resolvers_deinit(void) free(resolvers->id); free((char *)resolvers->conf.file); task_destroy(resolvers->t); - LIST_DEL(&resolvers->list); + LIST_DELETE(&resolvers->list); free(resolvers); } list_for_each_entry_safe(srvrq, srvrqback, &resolv_srvrq_list, list) { free(srvrq->name); free(srvrq->hostname_dn); - LIST_DEL(&srvrq->list); + LIST_DELETE(&srvrq->list); free(srvrq); } } @@ -2945,7 +2945,7 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) curr_resolvers->px = p; /* default values */ - LIST_ADDQ(&sec_resolvers, &curr_resolvers->list); + LIST_APPEND(&sec_resolvers, &curr_resolvers->list); curr_resolvers->conf.file = strdup(file); curr_resolvers->conf.line = linenum; curr_resolvers->id = strdup(args[1]); @@ -3048,7 +3048,7 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) newnameserver->process_responses = resolv_process_responses; newnameserver->conf.line = linenum; /* the nameservers are linked backward first */ - LIST_ADDQ(&curr_resolvers->nameservers, &newnameserver->list); + LIST_APPEND(&curr_resolvers->nameservers, &newnameserver->list); } else if (strcmp(args[0], "parse-resolv-conf") == 0) { struct dns_nameserver *newnameserver = NULL; @@ -3163,7 +3163,7 @@ int cfg_parse_resolvers(const char *file, int linenum, char **args, int kwm) newnameserver->parent = curr_resolvers; newnameserver->process_responses = resolv_process_responses; newnameserver->conf.line = resolv_linenum; - LIST_ADDQ(&curr_resolvers->nameservers, &newnameserver->list); + LIST_APPEND(&curr_resolvers->nameservers, &newnameserver->list); } resolv_out: diff --git a/src/ring.c b/src/ring.c index e7664d0b46..4f1bca270e 100644 --- a/src/ring.c +++ b/src/ring.c @@ -363,7 +363,7 @@ int cli_io_handler_show_ring(struct appctx *appctx) if (!si_oc(si)->output && !(si_oc(si)->flags & CF_SHUTW)) { /* let's be woken up once new data arrive */ HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock); - LIST_ADDQ(&ring->waiters, &appctx->wait_entry); + LIST_APPEND(&ring->waiters, &appctx->wait_entry); HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock); si_rx_endp_done(si); ret = 0; diff --git a/src/sample.c b/src/sample.c index ed60631687..b48cf71c27 100644 --- a/src/sample.c +++ b/src/sample.c @@ -398,7 +398,7 @@ void sample_register_fetches(struct sample_fetch_kw_list *kwl) if (sf->use & (1 << bit)) sf->val |= fetch_cap[bit]; } - LIST_ADDQ(&sample_fetches.list, &kwl->list); + LIST_APPEND(&sample_fetches.list, &kwl->list); } /* @@ -407,7 +407,7 @@ void sample_register_fetches(struct sample_fetch_kw_list *kwl) */ void sample_register_convs(struct sample_conv_kw_list *pckl) { - LIST_ADDQ(&sample_convs.list, &pckl->list); + LIST_APPEND(&sample_convs.list, &pckl->list); } /* @@ -1018,7 +1018,7 @@ struct sample_expr *sample_parse_expr(char **str, int *idx, const char *file, in if (!conv_expr) goto out_error; - LIST_ADDQ(&(expr->conv_exprs), &(conv_expr->list)); + LIST_APPEND(&(expr->conv_exprs), &(conv_expr->list)); conv_expr->conv = conv; al->kw = expr->fetch->kw; @@ -1372,7 +1372,7 @@ int smp_resolve_args(struct proxy *p, char **err) } - LIST_DEL(&cur->list); + LIST_DELETE(&cur->list); free(cur); } /* end of args processing */ @@ -1455,7 +1455,7 @@ void release_sample_expr(struct sample_expr *expr) return; list_for_each_entry_safe(conv_expr, conv_exprb, &expr->conv_exprs, list) { - LIST_DEL(&conv_expr->list); + LIST_DELETE(&conv_expr->list); release_sample_arg(conv_expr->arg_p); free(conv_expr); } diff --git a/src/server.c b/src/server.c index fb7b750c7f..d8fb65a166 100644 --- a/src/server.c +++ b/src/server.c @@ -233,7 +233,7 @@ static void srv_set_addr_desc(struct server *s) */ void srv_register_keywords(struct srv_kw_list *kwl) { - LIST_ADDQ(&srv_keywords.list, &kwl->list); + LIST_APPEND(&srv_keywords.list, &kwl->list); } /* Return a pointer to the server keyword , or NULL if not found. If the @@ -2151,7 +2151,7 @@ struct server *new_server(struct proxy *proxy) srv->obj_type = OBJ_TYPE_SERVER; srv->proxy = proxy; srv->pendconns = EB_ROOT; - LIST_ADDQ(&servers_list, &srv->global_list); + LIST_APPEND(&servers_list, &srv->global_list); srv->next_state = SRV_ST_RUNNING; /* early server setup */ srv->last_change = now.tv_sec; @@ -2204,7 +2204,7 @@ void free_server(struct server *srv) } HA_SPIN_DESTROY(&srv->lock); - LIST_DEL(&srv->global_list); + LIST_DELETE(&srv->global_list); EXTRA_COUNTERS_FREE(srv->extra_counters); @@ -2313,7 +2313,7 @@ static int _srv_parse_tmpl_init(struct server *srv, struct proxy *px) #endif free_check(&newsrv->agent); free_check(&newsrv->check); - LIST_DEL(&newsrv->global_list); + LIST_DELETE(&newsrv->global_list); } free(newsrv); return i - srv->tmpl_info.nb_low; @@ -5045,7 +5045,7 @@ static int srv_migrate_conns_to_remove(struct eb_root *idle_tree, struct mt_list hash_node = ebmb_entry(node, struct conn_hash_node, node); eb_delete(node); - MT_LIST_ADDQ(toremove_list, &hash_node->conn->toremove_list); + MT_LIST_APPEND(toremove_list, &hash_node->conn->toremove_list); i++; node = next; diff --git a/src/shctx.c b/src/shctx.c index f4002a48e0..1160a1b253 100644 --- a/src/shctx.c +++ b/src/shctx.c @@ -371,7 +371,7 @@ int shctx_init(struct shared_context **orig_shctx, int maxblocks, int blocksize, cur_block->len = 0; cur_block->refcount = 0; cur_block->block_count = 1; - LIST_ADDQ(&shctx->avail, &cur_block->list); + LIST_APPEND(&shctx->avail, &cur_block->list); shctx->nbav++; cur += sizeof(struct shared_block) + blocksize; } diff --git a/src/signal.c b/src/signal.c index 946157e01f..5ec71429c2 100644 --- a/src/signal.c +++ b/src/signal.c @@ -154,7 +154,7 @@ void deinit_signals() if (sig != SIGPROF) signal(sig, SIG_DFL); list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) { - LIST_DEL(&sh->list); + LIST_DELETE(&sh->list); pool_free(pool_head_sig_handlers, sh); } } @@ -188,7 +188,7 @@ struct sig_handler *signal_register_fct(int sig, void (*fct)(struct sig_handler sh->handler = fct; sh->arg = arg; sh->flags = SIG_F_TYPE_FCT; - LIST_ADDQ(&signal_state[sig].handlers, &sh->list); + LIST_APPEND(&signal_state[sig].handlers, &sh->list); return sh; } @@ -220,7 +220,7 @@ struct sig_handler *signal_register_task(int sig, struct task *task, int reason) sh->handler = task; sh->arg = reason & ~TASK_WOKEN_ANY; sh->flags = SIG_F_TYPE_TASK; - LIST_ADDQ(&signal_state[sig].handlers, &sh->list); + LIST_APPEND(&signal_state[sig].handlers, &sh->list); return sh; } @@ -229,7 +229,7 @@ struct sig_handler *signal_register_task(int sig, struct task *task, int reason) */ void signal_unregister_handler(struct sig_handler *handler) { - LIST_DEL(&handler->list); + LIST_DELETE(&handler->list); pool_free(pool_head_sig_handlers, handler); } @@ -251,7 +251,7 @@ void signal_unregister_target(int sig, void *target) list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) { if (sh->handler == target) { - LIST_DEL(&sh->list); + LIST_DELETE(&sh->list); pool_free(pool_head_sig_handlers, sh); break; } @@ -271,7 +271,7 @@ void signal_unregister(int sig) return; list_for_each_entry_safe(sh, shb, &signal_state[sig].handlers, list) { - LIST_DEL(&sh->list); + LIST_DELETE(&sh->list); pool_free(pool_head_sig_handlers, sh); } diff --git a/src/sink.c b/src/sink.c index 1c6536a9c9..63d37786f0 100644 --- a/src/sink.c +++ b/src/sink.c @@ -77,7 +77,7 @@ static struct sink *__sink_new(const char *name, const char *desc, int fmt) sink->ctx.fd = -1; sink->ctx.dropped = 0; HA_RWLOCK_INIT(&sink->ctx.lock); - LIST_ADDQ(&sink_list, &sink->sink_list); + LIST_APPEND(&sink_list, &sink->sink_list); end: return sink; @@ -139,7 +139,7 @@ struct sink *sink_new_buf(const char *name, const char *desc, enum log_fmt fmt, sink->ctx.ring = ring_new(size); if (!sink->ctx.ring) { - LIST_DEL(&sink->sink_list); + LIST_DELETE(&sink->sink_list); free(sink->name); free(sink->desc); free(sink); @@ -410,7 +410,7 @@ static void sink_forward_io_handler(struct appctx *appctx) if (ret) { /* let's be woken up once new data arrive */ HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock); - LIST_ADDQ(&ring->waiters, &appctx->wait_entry); + LIST_APPEND(&ring->waiters, &appctx->wait_entry); HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock); si_rx_endp_done(si); } @@ -554,7 +554,7 @@ static void sink_forward_oc_io_handler(struct appctx *appctx) if (ret) { /* let's be woken up once new data arrive */ HA_RWLOCK_WRLOCK(LOGSRV_LOCK, &ring->lock); - LIST_ADDQ(&ring->waiters, &appctx->wait_entry); + LIST_APPEND(&ring->waiters, &appctx->wait_entry); HA_RWLOCK_WRUNLOCK(LOGSRV_LOCK, &ring->lock); si_rx_endp_done(si); } @@ -680,7 +680,7 @@ static struct appctx *sink_forward_session_create(struct sink *sink, struct sink /* Error unrolling */ out_free_strm: - LIST_DEL(&s->list); + LIST_DELETE(&s->list); pool_free(pool_head_stream, s); out_free_sess: session_free(sess); @@ -1061,7 +1061,7 @@ struct sink *sink_new_from_logsrv(struct logsrv *logsrv) if (sink->ctx.ring) ring_free(sink->ctx.ring); - LIST_DEL(&sink->sink_list); + LIST_DELETE(&sink->sink_list); free(sink->name); free(sink->desc); free(sink); @@ -1256,7 +1256,7 @@ static void sink_deinit() list_for_each_entry_safe(sink, sb, &sink_list, sink_list) { if (sink->type == SINK_TYPE_BUFFER) ring_free(sink->ctx.ring); - LIST_DEL(&sink->sink_list); + LIST_DELETE(&sink->sink_list); free(sink->name); free(sink->desc); free(sink); diff --git a/src/ssl_ckch.c b/src/ssl_ckch.c index 7c3da05cb6..7504c55b87 100644 --- a/src/ssl_ckch.c +++ b/src/ssl_ckch.c @@ -894,14 +894,14 @@ void ckch_inst_free(struct ckch_inst *inst) list_for_each_entry_safe(sni, sni_s, &inst->sni_ctx, by_ckch_inst) { SSL_CTX_free(sni->ctx); - LIST_DEL(&sni->by_ckch_inst); + LIST_DELETE(&sni->by_ckch_inst); ebmb_delete(&sni->name); free(sni); } SSL_CTX_free(inst->ctx); inst->ctx = NULL; - LIST_DEL(&inst->by_ckchs); - LIST_DEL(&inst->by_crtlist_entry); + LIST_DELETE(&inst->by_ckchs); + LIST_DELETE(&inst->by_crtlist_entry); free(inst); } @@ -1359,7 +1359,7 @@ static int cli_io_handler_commit_cert(struct appctx *appctx) /* display one dot per new instance */ chunk_appendf(trash, "."); /* link the new ckch_inst to the duplicate */ - LIST_ADDQ(&new_ckchs->ckch_inst, &new_inst->by_ckchs); + LIST_APPEND(&new_ckchs->ckch_inst, &new_inst->by_ckchs); y++; } appctx->st2 = SETCERT_ST_INSERT; @@ -1385,7 +1385,7 @@ static int cli_io_handler_commit_cert(struct appctx *appctx) /* insert the new ckch_insts in the crtlist_entry */ list_for_each_entry(ckchi, &new_ckchs->ckch_inst, by_ckchs) { if (ckchi->crtlist_entry) - LIST_ADD(&ckchi->crtlist_entry->ckch_inst, &ckchi->by_crtlist_entry); + LIST_INSERT(&ckchi->crtlist_entry->ckch_inst, &ckchi->by_crtlist_entry); } /* First, we insert every new SNIs in the trees, also replace the default_ctx */ diff --git a/src/ssl_crtlist.c b/src/ssl_crtlist.c index e7a8b53fb3..f8f536095b 100644 --- a/src/ssl_crtlist.c +++ b/src/ssl_crtlist.c @@ -177,8 +177,8 @@ void crtlist_entry_free(struct crtlist_entry *entry) return; ebpt_delete(&entry->node); - LIST_DEL(&entry->by_crtlist); - LIST_DEL(&entry->by_ckch_store); + LIST_DELETE(&entry->by_crtlist); + LIST_DELETE(&entry->by_ckch_store); crtlist_free_filters(entry->filters); ssl_sock_free_ssl_conf(entry->ssl_conf); free(entry->ssl_conf); @@ -240,7 +240,7 @@ struct crtlist_entry *crtlist_entry_new() LIST_INIT(&entry->ckch_inst); - /* initialize the nodes so we can LIST_DEL in any cases */ + /* initialize the nodes so we can LIST_DELETE in any cases */ LIST_INIT(&entry->by_crtlist); LIST_INIT(&entry->by_ckch_store); @@ -540,8 +540,8 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu entry->node.key = ckchs; entry->crtlist = newlist; ebpt_insert(&newlist->entries, &entry->node); - LIST_ADDQ(&newlist->ord_entries, &entry->by_crtlist); - LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store); + LIST_APPEND(&newlist->ord_entries, &entry->by_crtlist); + LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store); } else if (global_ssl.extra_files & SSL_GF_BUNDLE) { /* If we didn't find the file, this could be a @@ -588,8 +588,8 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu entry_dup->node.key = ckchs; entry_dup->crtlist = newlist; ebpt_insert(&newlist->entries, &entry_dup->node); - LIST_ADDQ(&newlist->ord_entries, &entry_dup->by_crtlist); - LIST_ADDQ(&ckchs->crtlist_entry, &entry_dup->by_ckch_store); + LIST_APPEND(&newlist->ord_entries, &entry_dup->by_crtlist); + LIST_APPEND(&ckchs->crtlist_entry, &entry_dup->by_ckch_store); entry_dup = NULL; /* the entry was used, we need a new one next round */ } @@ -611,8 +611,8 @@ int crtlist_parse_file(char *file, struct bind_conf *bind_conf, struct proxy *cu entry->node.key = ckchs; entry->crtlist = newlist; ebpt_insert(&newlist->entries, &entry->node); - LIST_ADDQ(&newlist->ord_entries, &entry->by_crtlist); - LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store); + LIST_APPEND(&newlist->ord_entries, &entry->by_crtlist); + LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store); found++; } entry = NULL; @@ -706,8 +706,8 @@ int crtlist_load_cert_dir(char *path, struct bind_conf *bind_conf, struct crtlis } entry->node.key = ckchs; entry->crtlist = dir; - LIST_ADDQ(&ckchs->crtlist_entry, &entry->by_ckch_store); - LIST_ADDQ(&dir->ord_entries, &entry->by_crtlist); + LIST_APPEND(&ckchs->crtlist_entry, &entry->by_ckch_store); + LIST_APPEND(&dir->ord_entries, &entry->by_crtlist); ebpt_insert(&dir->entries, &entry->node); ignore_entry: @@ -1016,8 +1016,8 @@ static void cli_release_add_crtlist(struct appctx *appctx) struct ckch_inst *inst, *inst_s; /* upon error free the ckch_inst and everything inside */ ebpt_delete(&entry->node); - LIST_DEL(&entry->by_crtlist); - LIST_DEL(&entry->by_ckch_store); + LIST_DELETE(&entry->by_crtlist); + LIST_DELETE(&entry->by_ckch_store); list_for_each_entry_safe(inst, inst_s, &entry->ckch_inst, by_ckchs) { ckch_inst_free(inst); @@ -1102,8 +1102,8 @@ static int cli_io_handler_add_crtlist(struct appctx *appctx) /* display one dot for each new instance */ chunk_appendf(trash, "."); i++; - LIST_ADDQ(&store->ckch_inst, &new_inst->by_ckchs); - LIST_ADDQ(&entry->ckch_inst, &new_inst->by_crtlist_entry); + LIST_APPEND(&store->ckch_inst, &new_inst->by_ckchs); + LIST_APPEND(&entry->ckch_inst, &new_inst->by_crtlist_entry); new_inst->crtlist_entry = entry; } appctx->st2 = SETCERT_ST_INSERT; @@ -1272,9 +1272,9 @@ static int cli_parse_add_crtlist(char **args, char *payload, struct appctx *appc goto error; } - LIST_ADDQ(&crtlist->ord_entries, &entry->by_crtlist); + LIST_APPEND(&crtlist->ord_entries, &entry->by_crtlist); entry->crtlist = crtlist; - LIST_ADDQ(&store->crtlist_entry, &entry->by_ckch_store); + LIST_APPEND(&store->crtlist_entry, &entry->by_ckch_store); appctx->st2 = SETCERT_ST_INIT; appctx->ctx.cli.p0 = crtlist; @@ -1402,8 +1402,8 @@ static int cli_parse_del_crtlist(char **args, char *payload, struct appctx *appc /* upon error free the ckch_inst and everything inside */ ebpt_delete(&entry->node); - LIST_DEL(&entry->by_crtlist); - LIST_DEL(&entry->by_ckch_store); + LIST_DELETE(&entry->by_crtlist); + LIST_DELETE(&entry->by_ckch_store); list_for_each_entry_safe(inst, inst_s, &entry->ckch_inst, by_crtlist_entry) { struct sni_ctx *sni, *sni_s; @@ -1411,12 +1411,12 @@ static int cli_parse_del_crtlist(char **args, char *payload, struct appctx *appc HA_RWLOCK_WRLOCK(SNI_LOCK, &inst->bind_conf->sni_lock); list_for_each_entry_safe(sni, sni_s, &inst->sni_ctx, by_ckch_inst) { ebmb_delete(&sni->name); - LIST_DEL(&sni->by_ckch_inst); + LIST_DELETE(&sni->by_ckch_inst); SSL_CTX_free(sni->ctx); free(sni); } HA_RWLOCK_WRUNLOCK(SNI_LOCK, &inst->bind_conf->sni_lock); - LIST_DEL(&inst->by_ckchs); + LIST_DELETE(&inst->by_ckchs); free(inst); } diff --git a/src/ssl_sock.c b/src/ssl_sock.c index d3e593182b..fbf23d5bf8 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -590,7 +590,7 @@ int ssl_sock_register_msg_callback(ssl_sock_msg_callback_func func) cbk->func = func; - LIST_ADDQ(&ssl_sock_msg_callbacks, &cbk->list); + LIST_APPEND(&ssl_sock_msg_callbacks, &cbk->list); return 1; } @@ -625,7 +625,7 @@ static void ssl_sock_unregister_msg_callbacks(void) struct ssl_sock_msg_callback *cbk, *cbkback; list_for_each_entry_safe(cbk, cbkback, &ssl_sock_msg_callbacks, list) { - LIST_DEL(&cbk->list); + LIST_DELETE(&cbk->list); free(cbk); } } @@ -686,7 +686,7 @@ int ssl_init_single_engine(const char *engine_id, const char *def_algorithms) el = calloc(1, sizeof(*el)); el->e = engine; - LIST_ADD(&openssl_engines, &el->list); + LIST_INSERT(&openssl_engines, &el->list); nb_engines++; if (global_ssl.async) global.ssl_used_async_engines = nb_engines; @@ -1233,20 +1233,20 @@ static int tlskeys_finalize_config(void) /* This sort the reference list by id. */ list_for_each_entry_safe(ref, ref2, &tlskeys_reference, list) { - LIST_DEL(&ref->list); + LIST_DELETE(&ref->list); list_for_each_entry(ref3, &tkr, list) { if (ref->unique_id < ref3->unique_id) { - LIST_ADDQ(&ref3->list, &ref->list); + LIST_APPEND(&ref3->list, &ref->list); break; } } if (&ref3->list == &tkr) - LIST_ADDQ(&tkr, &ref->list); + LIST_APPEND(&tkr, &ref->list); } /* swap root */ - LIST_ADD(&tkr, &tlskeys_reference); - LIST_DEL(&tkr); + LIST_INSERT(&tkr, &tlskeys_reference); + LIST_DELETE(&tkr); return ERR_NONE; } #endif /* SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB */ @@ -2926,7 +2926,7 @@ static int ckch_inst_add_cert_sni(SSL_CTX *ctx, struct ckch_inst *ckch_inst, sc->wild = wild; sc->name.node.leaf_p = NULL; sc->ckch_inst = ckch_inst; - LIST_ADDQ(&ckch_inst->sni_ctx, &sc->by_ckch_inst); + LIST_APPEND(&ckch_inst->sni_ctx, &sc->by_ckch_inst); } return order; } @@ -2960,7 +2960,7 @@ void ssl_sock_load_cert_sni(struct ckch_inst *ckch_inst, struct bind_conf *bind_ if (sc1->ctx == sc0->ctx && sc1->conf == sc0->conf && sc1->neg == sc0->neg && sc1->wild == sc0->wild) { /* it's a duplicate, we should remove and free it */ - LIST_DEL(&sc0->by_ckch_inst); + LIST_DELETE(&sc0->by_ckch_inst); SSL_CTX_free(sc0->ctx); ha_free(&sc0); break; @@ -3526,7 +3526,7 @@ static int ssl_sock_load_ckchs(const char *path, struct ckch_store *ckchs, ssl_sock_load_cert_sni(*ckch_inst, bind_conf); /* succeed, add the instance to the ckch_store's list of instance */ - LIST_ADDQ(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs)); + LIST_APPEND(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs)); return errcode; } @@ -3550,7 +3550,7 @@ static int ssl_sock_load_srv_ckchs(const char *path, struct ckch_store *ckchs, SSL_CTX_up_ref((*ckch_inst)->ctx); server->ssl_ctx.ctx = (*ckch_inst)->ctx; /* succeed, add the instance to the ckch_store's list of instance */ - LIST_ADDQ(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs)); + LIST_APPEND(&ckchs->ckch_inst, &((*ckch_inst)->by_ckchs)); return errcode; } @@ -3634,7 +3634,7 @@ int ssl_sock_load_cert_list_file(char *file, int dir, struct bind_conf *bind_con memprintf(err, "error processing line %d in file '%s' : %s", entry->linenum, file, *err); goto error; } - LIST_ADDQ(&entry->ckch_inst, &ckch_inst->by_crtlist_entry); + LIST_APPEND(&entry->ckch_inst, &ckch_inst->by_crtlist_entry); ckch_inst->crtlist_entry = entry; } @@ -5037,7 +5037,7 @@ void ssl_sock_free_all_ctx(struct bind_conf *bind_conf) back = ebmb_next(node); ebmb_delete(node); SSL_CTX_free(sni->ctx); - LIST_DEL(&sni->by_ckch_inst); + LIST_DELETE(&sni->by_ckch_inst); free(sni); node = back; } @@ -5048,7 +5048,7 @@ void ssl_sock_free_all_ctx(struct bind_conf *bind_conf) back = ebmb_next(node); ebmb_delete(node); SSL_CTX_free(sni->ctx); - LIST_DEL(&sni->by_ckch_inst); + LIST_DELETE(&sni->by_ckch_inst); free(sni); node = back; } @@ -5079,7 +5079,7 @@ void ssl_sock_destroy_bind_conf(struct bind_conf *bind_conf) if (bind_conf->keys_ref && !--bind_conf->keys_ref->refcount) { free(bind_conf->keys_ref->filename); free(bind_conf->keys_ref->tlskeys); - LIST_DEL(&bind_conf->keys_ref->list); + LIST_DELETE(&bind_conf->keys_ref->list); free(bind_conf->keys_ref); } bind_conf->keys_ref = NULL; @@ -7217,7 +7217,7 @@ void ssl_free_engines(void) { list_for_each_entry_safe(wl, wlb, &openssl_engines, list) { ENGINE_finish(wl->e); ENGINE_free(wl->e); - LIST_DEL(&wl->list); + LIST_DELETE(&wl->list); free(wl); } } diff --git a/src/stats.c b/src/stats.c index bfd05bbe2b..a2741da121 100644 --- a/src/stats.c +++ b/src/stats.c @@ -4935,7 +4935,7 @@ void stats_register_module(struct stats_module *m) { const uint8_t domain = stats_get_domain(m->domain_flags); - LIST_ADDQ(&stats_module_list[domain], &m->list); + LIST_APPEND(&stats_module_list[domain], &m->list); stat_count[domain] += m->stats_count; } diff --git a/src/stream.c b/src/stream.c index 6c60cd495b..99552c44de 100644 --- a/src/stream.c +++ b/src/stream.c @@ -548,7 +548,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin, struct bu s->tunnel_timeout = TICK_ETERNITY; - LIST_ADDQ(&ti->streams, &s->list); + LIST_APPEND(&ti->streams, &s->list); if (flt_stream_init(s) < 0 || flt_stream_start(s) < 0) goto out_fail_accept; @@ -586,7 +586,7 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin, struct bu flt_stream_release(s, 0); task_destroy(t); tasklet_free(s->si[1].wait_event.tasklet); - LIST_DEL(&s->list); + LIST_DELETE(&s->list); out_fail_alloc_si1: tasklet_free(s->si[0].wait_event.tasklet); out_fail_alloc: @@ -641,7 +641,7 @@ static void stream_free(struct stream *s) put_pipe(s->res.pipe); /* We may still be present in the buffer wait queue */ - if (LIST_ADDED(&s->buffer_wait.list)) + if (LIST_INLIST(&s->buffer_wait.list)) LIST_DEL_INIT(&s->buffer_wait.list); if (s->req.buf.size || s->res.buf.size) { @@ -721,11 +721,11 @@ static void stream_free(struct stream *s) */ LIST_DEL_INIT(&bref->users); if (s->list.n != &ti->streams) - LIST_ADDQ(&LIST_ELEM(s->list.n, struct stream *, list)->back_refs, &bref->users); + LIST_APPEND(&LIST_ELEM(s->list.n, struct stream *, list)->back_refs, &bref->users); bref->ref = s->list.n; __ha_barrier_store(); } - LIST_DEL(&s->list); + LIST_DELETE(&s->list); /* applets do not release session yet */ must_free_sess = objt_appctx(sess->origin) && sess->origin == s->si[0].end; @@ -772,13 +772,13 @@ static void stream_free(struct stream *s) */ static int stream_alloc_work_buffer(struct stream *s) { - if (LIST_ADDED(&s->buffer_wait.list)) + if (LIST_INLIST(&s->buffer_wait.list)) LIST_DEL_INIT(&s->buffer_wait.list); if (b_alloc(&s->res.buf)) return 1; - LIST_ADDQ(&ti->buffer_wq, &s->buffer_wait.list); + LIST_APPEND(&ti->buffer_wq, &s->buffer_wait.list); return 0; } @@ -2988,7 +2988,7 @@ static enum act_parse_ret stream_parse_use_service(const char **args, int *cur_a void service_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&service_keywords, &kw_list->list); + LIST_APPEND(&service_keywords, &kw_list->list); } struct action_kw *service_find(const char *kw) @@ -3074,7 +3074,7 @@ static int stats_dump_full_strm_to_buffer(struct stream_interface *si, struct st chunk_appendf(&trash, " flags=0x%x, conn_retries=%d, srv_conn=%p, pend_pos=%p waiting=%d epoch=%#x\n", strm->flags, strm->si[1].conn_retries, strm->srv_conn, strm->pend_pos, - LIST_ADDED(&strm->buffer_wait.list), strm->stream_epoch); + LIST_INLIST(&strm->buffer_wait.list), strm->stream_epoch); chunk_appendf(&trash, " frontend=%s (id=%u mode=%s), listener=%s (id=%u)", @@ -3398,7 +3398,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx) */ if (appctx->st2 == STAT_ST_LIST) { if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) { - LIST_DEL(&appctx->ctx.sess.bref.users); + LIST_DELETE(&appctx->ctx.sess.bref.users); LIST_INIT(&appctx->ctx.sess.bref.users); } } @@ -3424,7 +3424,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx) case STAT_ST_LIST: /* first, let's detach the back-ref from a possible previous stream */ if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) { - LIST_DEL(&appctx->ctx.sess.bref.users); + LIST_DELETE(&appctx->ctx.sess.bref.users); LIST_INIT(&appctx->ctx.sess.bref.users); } @@ -3455,13 +3455,13 @@ static int cli_io_handler_dump_sess(struct appctx *appctx) if (appctx->ctx.sess.target != (void *)-1 && appctx->ctx.sess.target != curr_strm) goto next_sess; - LIST_ADDQ(&curr_strm->back_refs, &appctx->ctx.sess.bref.users); + LIST_APPEND(&curr_strm->back_refs, &appctx->ctx.sess.bref.users); /* call the proper dump() function and return if we're missing space */ if (!stats_dump_full_strm_to_buffer(si, curr_strm)) goto full; /* stream dump complete */ - LIST_DEL(&appctx->ctx.sess.bref.users); + LIST_DELETE(&appctx->ctx.sess.bref.users); LIST_INIT(&appctx->ctx.sess.bref.users); if (appctx->ctx.sess.target != (void *)-1) { appctx->ctx.sess.target = NULL; @@ -3583,7 +3583,7 @@ static int cli_io_handler_dump_sess(struct appctx *appctx) /* let's try again later from this stream. We add ourselves into * this stream's users so that it can remove us upon termination. */ - LIST_ADDQ(&curr_strm->back_refs, &appctx->ctx.sess.bref.users); + LIST_APPEND(&curr_strm->back_refs, &appctx->ctx.sess.bref.users); goto full; } @@ -3630,7 +3630,7 @@ static void cli_release_show_sess(struct appctx *appctx) */ thread_isolate(); if (!LIST_ISEMPTY(&appctx->ctx.sess.bref.users)) - LIST_DEL(&appctx->ctx.sess.bref.users); + LIST_DELETE(&appctx->ctx.sess.bref.users); thread_release(); } } diff --git a/src/task.c b/src/task.c index ca678d3d16..67633275dd 100644 --- a/src/task.c +++ b/src/task.c @@ -92,7 +92,7 @@ void task_kill(struct task *t) thr = my_ffsl(t->thread_mask) - 1; /* Beware: tasks that have never run don't have their ->list empty yet! */ - MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list, + MT_LIST_APPEND(&task_per_thread[thr].shared_tasklet_list, (struct mt_list *)&((struct tasklet *)t)->list); _HA_ATOMIC_INC(&task_per_thread[thr].rq_total); _HA_ATOMIC_INC(&task_per_thread[thr].tasks_in_list); @@ -115,30 +115,30 @@ void __tasklet_wakeup_on(struct tasklet *tl, int thr) if (likely(thr < 0)) { /* this tasklet runs on the caller thread */ if (tl->state & TASK_HEAVY) { - LIST_ADDQ(&sched->tasklets[TL_HEAVY], &tl->list); + LIST_APPEND(&sched->tasklets[TL_HEAVY], &tl->list); sched->tl_class_mask |= 1 << TL_HEAVY; } else if (tl->state & TASK_SELF_WAKING) { - LIST_ADDQ(&sched->tasklets[TL_BULK], &tl->list); + LIST_APPEND(&sched->tasklets[TL_BULK], &tl->list); sched->tl_class_mask |= 1 << TL_BULK; } else if ((struct task *)tl == sched->current) { _HA_ATOMIC_OR(&tl->state, TASK_SELF_WAKING); - LIST_ADDQ(&sched->tasklets[TL_BULK], &tl->list); + LIST_APPEND(&sched->tasklets[TL_BULK], &tl->list); sched->tl_class_mask |= 1 << TL_BULK; } else if (sched->current_queue < 0) { - LIST_ADDQ(&sched->tasklets[TL_URGENT], &tl->list); + LIST_APPEND(&sched->tasklets[TL_URGENT], &tl->list); sched->tl_class_mask |= 1 << TL_URGENT; } else { - LIST_ADDQ(&sched->tasklets[sched->current_queue], &tl->list); + LIST_APPEND(&sched->tasklets[sched->current_queue], &tl->list); sched->tl_class_mask |= 1 << sched->current_queue; } _HA_ATOMIC_INC(&sched->rq_total); } else { /* this tasklet runs on a specific thread. */ - MT_LIST_ADDQ(&task_per_thread[thr].shared_tasklet_list, (struct mt_list *)&tl->list); + MT_LIST_APPEND(&task_per_thread[thr].shared_tasklet_list, (struct mt_list *)&tl->list); _HA_ATOMIC_INC(&task_per_thread[thr].rq_total); if (sleeping_thread_mask & (1UL << thr)) { _HA_ATOMIC_AND(&sleeping_thread_mask, ~(1UL << thr)); @@ -688,7 +688,7 @@ void process_runnable_tasks() * 100% due to rounding, this is not a problem. Note that while in * theory the sum cannot be NULL as we cannot get there without tasklets * to process, in practice it seldom happens when multiple writers - * conflict and rollback on MT_LIST_TRY_ADDQ(shared_tasklet_list), causing + * conflict and rollback on MT_LIST_TRY_APPEND(shared_tasklet_list), causing * a first MT_LIST_ISEMPTY() to succeed for thread_has_task() and the * one above to finally fail. This is extremely rare and not a problem. */ @@ -766,7 +766,7 @@ void process_runnable_tasks() _HA_ATOMIC_DEC(&niced_tasks); /* Add it to the local task list */ - LIST_ADDQ(&tt->tasklets[TL_NORMAL], &((struct tasklet *)t)->list); + LIST_APPEND(&tt->tasklets[TL_NORMAL], &((struct tasklet *)t)->list); } /* release the rqueue lock */ diff --git a/src/tcp_rules.c b/src/tcp_rules.c index bb25e1c3d1..2e1eac4ee5 100644 --- a/src/tcp_rules.c +++ b/src/tcp_rules.c @@ -45,22 +45,22 @@ struct list tcp_res_cont_keywords = LIST_HEAD_INIT(tcp_res_cont_keywords); */ void tcp_req_conn_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&tcp_req_conn_keywords, &kw_list->list); + LIST_APPEND(&tcp_req_conn_keywords, &kw_list->list); } void tcp_req_sess_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&tcp_req_sess_keywords, &kw_list->list); + LIST_APPEND(&tcp_req_sess_keywords, &kw_list->list); } void tcp_req_cont_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&tcp_req_cont_keywords, &kw_list->list); + LIST_APPEND(&tcp_req_cont_keywords, &kw_list->list); } void tcp_res_cont_keywords_register(struct action_kw_list *kw_list) { - LIST_ADDQ(&tcp_res_cont_keywords, &kw_list->list); + LIST_APPEND(&tcp_res_cont_keywords, &kw_list->list); } /* @@ -1097,7 +1097,7 @@ static int tcp_parse_tcp_rep(char **args, int section_type, struct proxy *curpx, warn++; } - LIST_ADDQ(&curpx->tcp_rep.inspect_rules, &rule->list); + LIST_APPEND(&curpx->tcp_rep.inspect_rules, &rule->list); } else { memprintf(err, @@ -1213,7 +1213,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, /* the following function directly emits the warning */ warnif_misplaced_tcp_cont(curpx, file, line, args[0]); - LIST_ADDQ(&curpx->tcp_req.inspect_rules, &rule->list); + LIST_APPEND(&curpx->tcp_req.inspect_rules, &rule->list); } else if (strcmp(args[1], "connection") == 0) { arg++; @@ -1258,7 +1258,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, /* the following function directly emits the warning */ warnif_misplaced_tcp_conn(curpx, file, line, args[0]); - LIST_ADDQ(&curpx->tcp_req.l4_rules, &rule->list); + LIST_APPEND(&curpx->tcp_req.l4_rules, &rule->list); } else if (strcmp(args[1], "session") == 0) { arg++; @@ -1302,7 +1302,7 @@ static int tcp_parse_tcp_req(char **args, int section_type, struct proxy *curpx, /* the following function directly emits the warning */ warnif_misplaced_tcp_sess(curpx, file, line, args[0]); - LIST_ADDQ(&curpx->tcp_req.l5_rules, &rule->list); + LIST_APPEND(&curpx->tcp_req.l5_rules, &rule->list); } else { if (curpx == defpx) diff --git a/src/tcpcheck.c b/src/tcpcheck.c index 5a51471db1..bc6eb3c151 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -79,7 +79,7 @@ static void free_tcpcheck_fmt(struct list *fmt) struct logformat_node *lf, *lfb; list_for_each_entry_safe(lf, lfb, fmt, list) { - LIST_DEL(&lf->list); + LIST_DELETE(&lf->list); release_sample_expr(lf->expr); free(lf->arg); free(lf); @@ -105,7 +105,7 @@ static void free_tcpcheck_http_hdrs(struct list *hdrs) struct tcpcheck_http_hdr *hdr, *bhdr; list_for_each_entry_safe(hdr, bhdr, hdrs, list) { - LIST_DEL(&hdr->list); + LIST_DELETE(&hdr->list); free_tcpcheck_http_hdr(hdr); } } @@ -251,7 +251,7 @@ void free_tcpcheck_vars(struct list *vars) struct tcpcheck_var *var, *back; list_for_each_entry_safe(var, back, vars, list) { - LIST_DEL(&var->list); + LIST_DELETE(&var->list); free_tcpcheck_var(var); } } @@ -281,7 +281,7 @@ int dup_tcpcheck_vars(struct list *dst, const struct list *src) } else new->data.u = var->data.u; - LIST_ADDQ(dst, &new->list); + LIST_APPEND(dst, &new->list); } return 1; @@ -337,7 +337,7 @@ void free_tcpcheck_ruleset(struct tcpcheck_ruleset *rs) ebpt_delete(&rs->node); free(rs->node.key); list_for_each_entry_safe(r, rb, &rs->rules, list) { - LIST_DEL(&r->list); + LIST_DELETE(&r->list); free_tcpcheck(r, 0); } free(rs); @@ -2772,7 +2772,7 @@ struct tcpcheck_rule *parse_tcpcheck_send_http(char **args, int cur_arg, struct ist0(hdrs[i].v); if (!parse_logformat_string(istptr(hdrs[i].v), px, &hdr->value, 0, SMP_VAL_BE_CHK_RUL, errmsg)) goto error; - LIST_ADDQ(&chk->send.http.hdrs, &hdr->list); + LIST_APPEND(&chk->send.http.hdrs, &hdr->list); hdr = NULL; } @@ -3470,8 +3470,8 @@ void tcpcheck_overwrite_send_http_rule(struct tcpcheck_rule *old, struct tcpchec old->send.http.flags |= TCPCHK_SND_HTTP_FL_URI_FMT; LIST_INIT(&old->send.http.uri_fmt); list_for_each_entry_safe(lf, lfb, &new->send.http.uri_fmt, list) { - LIST_DEL(&lf->list); - LIST_ADDQ(&old->send.http.uri_fmt, &lf->list); + LIST_DELETE(&lf->list); + LIST_APPEND(&old->send.http.uri_fmt, &lf->list); } } @@ -3483,8 +3483,8 @@ void tcpcheck_overwrite_send_http_rule(struct tcpcheck_rule *old, struct tcpchec free_tcpcheck_http_hdrs(&old->send.http.hdrs); list_for_each_entry_safe(hdr, bhdr, &new->send.http.hdrs, list) { - LIST_DEL(&hdr->list); - LIST_ADDQ(&old->send.http.hdrs, &hdr->list); + LIST_DELETE(&hdr->list); + LIST_APPEND(&old->send.http.hdrs, &hdr->list); } if (!(new->send.http.flags & TCPCHK_SND_HTTP_FL_BODY_FMT) && isttest(new->send.http.body)) { @@ -3504,8 +3504,8 @@ void tcpcheck_overwrite_send_http_rule(struct tcpcheck_rule *old, struct tcpchec old->send.http.flags |= TCPCHK_SND_HTTP_FL_BODY_FMT; LIST_INIT(&old->send.http.body_fmt); list_for_each_entry_safe(lf, lfb, &new->send.http.body_fmt, list) { - LIST_DEL(&lf->list); - LIST_ADDQ(&old->send.http.body_fmt, &lf->list); + LIST_DELETE(&lf->list); + LIST_APPEND(&old->send.http.body_fmt, &lf->list); } } } @@ -3546,11 +3546,11 @@ int tcpcheck_add_http_rule(struct tcpcheck_rule *chk, struct tcpcheck_rules *rul if (r && r->action == TCPCHK_ACT_CONNECT) r = get_next_tcpcheck_rule(rules, r); if (!r || r->action != TCPCHK_ACT_SEND) - LIST_ADD(rules->list, &chk->list); + LIST_INSERT(rules->list, &chk->list); else if (r->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT) { - LIST_DEL(&r->list); + LIST_DELETE(&r->list); free_tcpcheck(r, 0); - LIST_ADD(rules->list, &chk->list); + LIST_INSERT(rules->list, &chk->list); } else { tcpcheck_overwrite_send_http_rule(r, chk); @@ -3588,12 +3588,12 @@ int tcpcheck_add_http_rule(struct tcpcheck_rule *chk, struct tcpcheck_rules *rul if (r && r->action == TCPCHK_ACT_SEND && (r->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT)) { tcpcheck_overwrite_send_http_rule(r, chk); free_tcpcheck(chk, 0); - LIST_DEL(&r->list); + LIST_DELETE(&r->list); r->send.http.flags &= ~TCPCHK_SND_HTTP_FROM_OPT; chk = r; } } - LIST_ADDQ(rules->list, &chk->list); + LIST_APPEND(rules->list, &chk->list); } return 1; } @@ -3632,8 +3632,8 @@ static int check_proxy_tcpcheck(struct proxy *px) if (chk && chk->action == TCPCHK_ACT_SEND && (chk->send.http.flags & TCPCHK_SND_HTTP_FROM_OPT)) { next = get_next_tcpcheck_rule(&px->tcpcheck_rules, chk); if (next && next->action == TCPCHK_ACT_CONNECT) { - LIST_DEL(&chk->list); - LIST_ADD(&next->list, &chk->list); + LIST_DELETE(&chk->list); + LIST_INSERT(&next->list, &chk->list); chk->index = next->index; } } @@ -3654,7 +3654,7 @@ static int check_proxy_tcpcheck(struct proxy *px) ret |= ERR_ALERT | ERR_FATAL; goto out; } - LIST_ADDQ(px->tcpcheck_rules.list, &next->list); + LIST_APPEND(px->tcpcheck_rules.list, &next->list); next->index = chk->index; } } @@ -3675,7 +3675,7 @@ static int check_proxy_tcpcheck(struct proxy *px) } chk->action = TCPCHK_ACT_CONNECT; chk->connect.options = (TCPCHK_OPT_DEFAULT_CONNECT|TCPCHK_OPT_IMPLICIT); - LIST_ADD(px->tcpcheck_rules.list, &chk->list); + LIST_INSERT(px->tcpcheck_rules.list, &chk->list); } /* Remove all comment rules. To do so, when a such rule is found, the @@ -3690,7 +3690,7 @@ static int check_proxy_tcpcheck(struct proxy *px) case TCPCHK_ACT_COMMENT: free(comment); comment = chk->comment; - LIST_DEL(&chk->list); + LIST_DELETE(&chk->list); free(chk); break; case TCPCHK_ACT_CONNECT: @@ -3733,7 +3733,7 @@ static void deinit_tcpchecks() free(node->key); rs = container_of(node, typeof(*rs), node); list_for_each_entry_safe(r, rb, &rs->rules, list) { - LIST_DEL(&r->list); + LIST_DELETE(&r->list); free_tcpcheck(r, 0); } free(rs); @@ -3776,7 +3776,7 @@ int add_tcpcheck_expect_str(struct tcpcheck_rules *rules, const char *str) if (prev_check->action != TCPCHK_ACT_COMMENT && prev_check->action != TCPCHK_ACT_ACTION_KW) break; } - LIST_ADDQ(rules->list, &tcpcheck->list); + LIST_APPEND(rules->list, &tcpcheck->list); return 1; } @@ -3809,7 +3809,7 @@ int add_tcpcheck_send_strs(struct tcpcheck_rules *rules, const char * const *str for (in = strs[i]; (*dst = *in++); dst++); *dst = 0; - LIST_ADDQ(rules->list, &tcpcheck->list); + LIST_APPEND(rules->list, &tcpcheck->list); return 1; } @@ -3877,7 +3877,7 @@ static int proxy_parse_tcpcheck(char **args, int section, struct proxy *curpx, /* No error: add the tcp-check rule in the list */ chk->index = index; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); if ((curpx->options2 & PR_O2_CHK_ANY) == PR_O2_TCPCHK_CHK && (curpx->tcpcheck_rules.flags & TCPCHK_RULES_PROTO_CHK) == TCPCHK_RULES_TCP_CHK) { @@ -3991,7 +3991,7 @@ static int proxy_parse_httpcheck(char **args, int section, struct proxy *curpx, else { /* mark this ruleset as unused for now */ curpx->tcpcheck_rules.flags |= TCPCHK_RULES_UNUSED_HTTP_RS; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); } out: @@ -4046,7 +4046,7 @@ int proxy_parse_redis_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "string", redis_res, "error-status", "L7STS", @@ -4059,7 +4059,7 @@ int proxy_parse_redis_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4147,7 +4147,7 @@ int proxy_parse_ssl_hello_chk_opt(char **args, int cur_arg, struct proxy *curpx, goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^1[56]", "min-recv", "5", "ok-status", "L6OK", @@ -4159,7 +4159,7 @@ int proxy_parse_ssl_hello_chk_opt(char **args, int cur_arg, struct proxy *curpx, goto error; } chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4225,7 +4225,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const var->data.u.str.area = cmd; var->data.u.str.data = strlen(cmd); LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); cmd = NULL; var = NULL; @@ -4246,7 +4246,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^[0-9]{3}[ \r]", "min-recv", "4", @@ -4259,7 +4259,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const goto error; } chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^2[0-9]{2}[ \r]", "min-recv", "4", @@ -4273,7 +4273,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const goto error; } chk->index = 2; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-lf", smtp_req, ""}, 1, curpx, &rs->rules, file, line, &errmsg); @@ -4282,7 +4282,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const goto error; } chk->index = 3; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^2[0-9]{2}[- \r]", "min-recv", "4", @@ -4297,7 +4297,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const goto error; } chk->index = 4; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4369,7 +4369,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c var->data.u.str.area = user; var->data.u.str.data = strlen(user); LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); user = NULL; var = NULL; @@ -4381,7 +4381,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c var->data.type = SMP_T_SINT; var->data.u.sint = packetlen; LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); var = NULL; } else { @@ -4407,7 +4407,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-binary-lf", pgsql_req, ""}, 1, curpx, &rs->rules, file, line, &errmsg); @@ -4416,7 +4416,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "!rstring", "^E", "min-recv", "5", @@ -4429,7 +4429,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 2; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^52000000(08|0A|0C)000000(00|02|03|04|05|06)", "min-recv", "9", @@ -4443,7 +4443,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = 3; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4599,7 +4599,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c var->data.u.str.area = hdr; var->data.u.str.data = 4; LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); hdr = NULL; var = NULL; @@ -4612,7 +4612,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c var->data.u.str.area = user; var->data.u.str.data = strlen(user); LIST_INIT(&var->list); - LIST_ADDQ(&rules->preset_vars, &var->list); + LIST_APPEND(&rules->preset_vars, &var->list); user = NULL; var = NULL; } @@ -4634,7 +4634,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = index++; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); if (mysql_req) { chk = parse_tcpcheck_send((char *[]){"tcp-check", "send-binary-lf", mysql_req, ""}, @@ -4644,7 +4644,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c goto error; } chk->index = index++; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); } chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""}, @@ -4655,7 +4655,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c } chk->expect.custom = tcpcheck_mysql_expect_iniths; chk->index = index++; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); if (mysql_req) { chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""}, @@ -4666,7 +4666,7 @@ int proxy_parse_mysql_check_opt(char **args, int cur_arg, struct proxy *curpx, c } chk->expect.custom = tcpcheck_mysql_expect_ok; chk->index = index++; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); } ruleset_found: @@ -4729,7 +4729,7 @@ int proxy_parse_ldap_check_opt(char **args, int cur_arg, struct proxy *curpx, co goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^30", "min-recv", "14", @@ -4741,7 +4741,7 @@ int proxy_parse_ldap_check_opt(char **args, int cur_arg, struct proxy *curpx, co goto error; } chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", ""}, 1, curpx, &rs->rules, TCPCHK_RULES_LDAP_CHK, file, line, &errmsg); @@ -4751,7 +4751,7 @@ int proxy_parse_ldap_check_opt(char **args, int cur_arg, struct proxy *curpx, co } chk->expect.custom = tcpcheck_ldap_expect_bindrsp; chk->index = 2; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4817,7 +4817,7 @@ int proxy_parse_spop_check_opt(char **args, int cur_arg, struct proxy *curpx, co goto error; } chk->index = 0; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "custom", "min-recv", "4", ""}, 1, curpx, &rs->rules, TCPCHK_RULES_SPOP_CHK, file, line, &errmsg); @@ -4827,7 +4827,7 @@ int proxy_parse_spop_check_opt(char **args, int cur_arg, struct proxy *curpx, co } chk->expect.custom = tcpcheck_spop_expect_agenthello; chk->index = 1; - LIST_ADDQ(&rs->rules, &chk->list); + LIST_APPEND(&rs->rules, &chk->list); ruleset_found: rules->list = &rs->rules; @@ -4951,7 +4951,7 @@ static struct tcpcheck_rule *proxy_parse_httpchk_req(char **args, int cur_arg, s ist0(tmp_hdrs[i].v); if (!parse_logformat_string(istptr(tmp_hdrs[i].v), px, &hdr->value, 0, SMP_VAL_BE_CHK_RUL, errmsg)) goto error; - LIST_ADDQ(&chk->send.http.hdrs, &hdr->list); + LIST_APPEND(&chk->send.http.hdrs, &hdr->list); } } diff --git a/src/tools.c b/src/tools.c index 7bb9b05987..c103817780 100644 --- a/src/tools.c +++ b/src/tools.c @@ -4427,7 +4427,7 @@ int list_append_word(struct list *li, const char *str, char **err) goto fail_wl_s; } - LIST_ADDQ(li, &wl->list); + LIST_APPEND(li, &wl->list); return 1; diff --git a/src/vars.c b/src/vars.c index 980b669c3a..03aade21f7 100644 --- a/src/vars.c +++ b/src/vars.c @@ -150,7 +150,7 @@ unsigned int var_clear(struct var *var) ha_free(&var->data.u.meth.str.area); size += var->data.u.meth.str.data; } - LIST_DEL(&var->l); + LIST_DELETE(&var->l); pool_free(var_pool, var); size += sizeof(struct var); return size; @@ -373,7 +373,7 @@ static int sample_store(struct vars *vars, const char *name, struct sample *smp) var = pool_alloc(var_pool); if (!var) return 0; - LIST_ADDQ(&vars->head, &var->l); + LIST_APPEND(&vars->head, &var->l); var->name = name; } diff --git a/src/xprt_quic.c b/src/xprt_quic.c index 2d51a994ea..68d0f604cb 100644 --- a/src/xprt_quic.c +++ b/src/xprt_quic.c @@ -855,7 +855,7 @@ static int quic_crypto_data_cpy(struct quic_enc_level *qel, frm->type = QUIC_FT_CRYPTO; frm->crypto.offset = cf_offset; frm->crypto.len = cf_len; - LIST_ADDQ(&qel->pktns->tx.frms, &frm->list); + LIST_APPEND(&qel->pktns->tx.frms, &frm->list); } return len == 0; @@ -1156,7 +1156,7 @@ static inline void qc_treat_acked_tx_frm(struct quic_tx_frm *frm, struct quic_conn_ctx *ctx) { TRACE_PROTO("Removing frame", QUIC_EV_CONN_PRSAFRM, ctx->conn, frm); - LIST_DEL(&frm->list); + LIST_DELETE(&frm->list); pool_free(pool_head_quic_tx_frm, frm); } @@ -1188,7 +1188,7 @@ static inline struct eb64_node *qc_ackrng_pkts(struct eb_root *pkts, unsigned in pkt = eb64_entry(&node->node, struct quic_tx_packet, pn_node); *pkt_flags |= pkt->flags; - LIST_ADD(newly_acked_pkts, &pkt->list); + LIST_INSERT(newly_acked_pkts, &pkt->list); TRACE_PROTO("Removing packet #", QUIC_EV_CONN_PRSAFRM, ctx->conn,, &pkt->pn_node.key); list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) qc_treat_acked_tx_frm(frm, ctx); @@ -1207,8 +1207,8 @@ static inline void qc_treat_nacked_tx_frm(struct quic_tx_frm *frm, struct quic_conn_ctx *ctx) { TRACE_PROTO("to resend frame", QUIC_EV_CONN_PRSAFRM, ctx->conn, frm); - LIST_DEL(&frm->list); - LIST_ADD(&pktns->tx.frms, &frm->list); + LIST_DELETE(&frm->list); + LIST_INSERT(&pktns->tx.frms, &frm->list); } @@ -1218,7 +1218,7 @@ static inline void free_quic_tx_pkts(struct list *pkts) struct quic_tx_packet *pkt, *tmp; list_for_each_entry_safe(pkt, tmp, pkts, list) { - LIST_DEL(&pkt->list); + LIST_DELETE(&pkt->list); eb64_delete(&pkt->pn_node); pool_free(pool_head_quic_tx_packet, pkt); } @@ -1267,7 +1267,7 @@ static inline void qc_treat_newly_acked_pkts(struct quic_conn_ctx *ctx, ev.ack.acked = pkt->in_flight_len; ev.ack.time_sent = pkt->time_sent; quic_cc_event(&qc->path->cc, &ev); - LIST_DEL(&pkt->list); + LIST_DELETE(&pkt->list); eb64_delete(&pkt->pn_node); pool_free(pool_head_quic_tx_packet, pkt); } @@ -1302,7 +1302,7 @@ static inline void qc_release_lost_pkts(struct quic_pktns *pktns, /* Treat the frames of this lost packet. */ list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) qc_treat_nacked_tx_frm(frm, pktns, ctx); - LIST_DEL(&pkt->list); + LIST_DELETE(&pkt->list); if (!oldest_lost) { oldest_lost = newest_lost = pkt; } @@ -1368,7 +1368,7 @@ static void qc_packet_loss_lookup(struct quic_pktns *pktns, if (tick_is_le(time_sent, now_ms) || (int64_t)largest_acked_pn >= pkt->pn_node.key + QUIC_LOSS_PACKET_THRESHOLD) { eb64_delete(&pkt->pn_node); - LIST_ADDQ(lost_pkts, &pkt->list); + LIST_APPEND(lost_pkts, &pkt->list); } else { pktns->tx.loss_time = tick_first(pktns->tx.loss_time, loss_time_limit); @@ -1851,7 +1851,7 @@ int qc_send_ppkts(struct quic_conn_ctx *ctx) if (p->in_flight_len) qc_set_timer(ctx); TRACE_PROTO("sent pkt", QUIC_EV_CONN_SPPKTS, ctx->conn, p); - LIST_DEL(&p->list); + LIST_DELETE(&p->list); } } @@ -1875,7 +1875,7 @@ static int quic_build_post_handshake_frames(struct quic_conn *conn) return 0; frm->type = QUIC_FT_HANDSHAKE_DONE; - LIST_ADDQ(&conn->tx.frms_to_send, &frm->list); + LIST_APPEND(&conn->tx.frms_to_send, &frm->list); } for (i = 1; i < conn->rx_tps.active_connection_id_limit; i++) { @@ -1887,7 +1887,7 @@ static int quic_build_post_handshake_frames(struct quic_conn *conn) goto err; quic_connection_id_to_frm_cpy(frm, cid); - LIST_ADDQ(&conn->tx.frms_to_send, &frm->list); + LIST_APPEND(&conn->tx.frms_to_send, &frm->list); } return 1; @@ -2982,7 +2982,7 @@ static ssize_t qc_lstnr_pkt_rcv(unsigned char **buf, const unsigned char *end, */ pkt->odcid_len = dcid_len; /* Enqueue this packet. */ - LIST_ADDQ(&l->rx.qpkts, &pkt->rx_list); + LIST_APPEND(&l->rx.qpkts, &pkt->rx_list); /* Try to accept a new connection. */ listener_accept(l); if (!qc->conn) { @@ -3276,8 +3276,8 @@ static inline int qc_build_cfrms(struct quic_tx_packet *pkt, room -= cflen; if (dlen == cf->crypto.len) { /* CRYPTO data have been consumed. */ - LIST_DEL(&cf->list); - LIST_ADDQ(&pkt->frms, &cf->list); + LIST_DELETE(&cf->list); + LIST_APPEND(&pkt->frms, &cf->list); } else { struct quic_tx_frm *new_cf; @@ -3291,7 +3291,7 @@ static inline int qc_build_cfrms(struct quic_tx_packet *pkt, new_cf->type = QUIC_FT_CRYPTO; new_cf->crypto.len = dlen; new_cf->crypto.offset = cf->crypto.offset; - LIST_ADDQ(&pkt->frms, &new_cf->list); + LIST_APPEND(&pkt->frms, &new_cf->list); /* Consume bytes of the current frame. */ cf->crypto.len -= dlen; cf->crypto.offset += dlen; @@ -3516,7 +3516,7 @@ static inline void free_quic_tx_packet(struct quic_tx_packet *pkt) struct quic_tx_frm *frm, *frmbak; list_for_each_entry_safe(frm, frmbak, &pkt->frms, list) { - LIST_DEL(&frm->list); + LIST_DELETE(&frm->list); pool_free(pool_head_quic_tx_frm, frm); } pool_free(pool_head_quic_tx_packet, pkt); @@ -3594,7 +3594,7 @@ static ssize_t qc_build_hdshk_pkt(struct q_buf *buf, struct quic_conn *qc, int p /* Increment the number of bytes in buffer by the length of this packet. */ buf->data += pkt_len; /* Attach this packet to . */ - LIST_ADDQ(&buf->pkts, &pkt->list); + LIST_APPEND(&buf->pkts, &pkt->list); TRACE_LEAVE(QUIC_EV_CONN_HPKT, qc->conn, pkt); return pkt_len; @@ -3712,8 +3712,8 @@ static ssize_t qc_do_build_phdshk_apkt(struct q_buf *wbuf, break; } - LIST_DEL(&frm->list); - LIST_ADDQ(&pkt->frms, &frm->list); + LIST_DELETE(&frm->list); + LIST_APPEND(&pkt->frms, &frm->list); pos = ppos; } @@ -3792,7 +3792,7 @@ static ssize_t qc_build_phdshk_apkt(struct q_buf *wbuf, struct quic_conn *qc) /* Increment the number of bytes in buffer by the length of this packet. */ wbuf->data += pkt_len; /* Attach this packet to . */ - LIST_ADDQ(&wbuf->pkts, &pkt->list); + LIST_APPEND(&wbuf->pkts, &pkt->list); TRACE_LEAVE(QUIC_EV_CONN_PAPKT, qc->conn, pkt); diff --git a/tests/unit/test-list.c b/tests/unit/test-list.c index a76c82a271..9e6ac38386 100644 --- a/tests/unit/test-list.c +++ b/tests/unit/test-list.c @@ -33,12 +33,12 @@ void *thread(void *pouet) case 0: lol = malloc(sizeof(*lol)); MT_LIST_INIT(&lol->list_elt); - MT_LIST_TRY_ADD(&pouet_list, &lol->list_elt); + MT_LIST_TRY_INSERT(&pouet_list, &lol->list_elt); break; case 1: lol = malloc(sizeof(*lol)); MT_LIST_INIT(&lol->list_elt); - MT_LIST_TRY_ADDQ(&pouet_list, &lol->list_elt); + MT_LIST_TRY_APPEND(&pouet_list, &lol->list_elt); break; case 2: @@ -52,7 +52,7 @@ void *thread(void *pouet) { if (random() % 2) { - MT_LIST_DEL_SAFE(elt1); + MT_LIST_DELETE_SAFE(elt1); free(lol); } if (random() % 2) {