CLEANUP: pools: rename all pool functions and pointers to remove this "2"
During the migration to the second version of the pools, the new
functions and pool pointers were all called "pool_something2()" and
"pool2_something". Now there's no more pool v1 code and it's a real
pain to still have to deal with this. Let's clean this up now by
removing the "2" everywhere, and by renaming the pool heads
"pool_head_something".
diff --git a/include/proto/applet.h b/include/proto/applet.h
index 8024981..cdd4d90 100644
--- a/include/proto/applet.h
+++ b/include/proto/applet.h
@@ -55,14 +55,14 @@
/* Tries to allocate a new appctx and initialize its main fields. The appctx
* is returned on success, NULL on failure. The appctx must be released using
- * pool_free2(connection) or appctx_free(), since it's allocated from the
+ * pool_free(connection) or appctx_free(), since it's allocated from the
* connection pool. <applet> is assigned as the applet, but it can be NULL.
*/
static inline struct appctx *appctx_new(struct applet *applet, unsigned long thread_mask)
{
struct appctx *appctx;
- appctx = pool_alloc2(pool2_connection);
+ appctx = pool_alloc(pool_head_connection);
if (likely(appctx != NULL)) {
appctx->obj_type = OBJ_TYPE_APPCTX;
appctx->applet = applet;
@@ -93,7 +93,7 @@
HA_SPIN_UNLOCK(BUF_WQ_LOCK, &buffer_wq_lock);
}
- pool_free2(pool2_connection, appctx);
+ pool_free(pool_head_connection, appctx);
HA_ATOMIC_SUB(&nb_applets, 1);
}
static inline void appctx_free(struct appctx *appctx)
diff --git a/include/proto/connection.h b/include/proto/connection.h
index c68ae20..0efce99 100644
--- a/include/proto/connection.h
+++ b/include/proto/connection.h
@@ -30,8 +30,8 @@
#include <proto/fd.h>
#include <proto/obj_type.h>
-extern struct pool_head *pool2_connection;
-extern struct pool_head *pool2_connstream;
+extern struct pool_head *pool_head_connection;
+extern struct pool_head *pool_head_connstream;
extern struct xprt_ops *registered_xprt[XPRT_ENTRIES];
extern struct alpn_mux_list alpn_mux_list;
@@ -642,13 +642,13 @@
/* Tries to allocate a new connection and initialized its main fields. The
* connection is returned on success, NULL on failure. The connection must
- * be released using pool_free2() or conn_free().
+ * be released using pool_free() or conn_free().
*/
static inline struct connection *conn_new()
{
struct connection *conn;
- conn = pool_alloc2(pool2_connection);
+ conn = pool_alloc(pool_head_connection);
if (likely(conn != NULL))
conn_init(conn);
return conn;
@@ -657,13 +657,13 @@
/* Releases a conn_stream previously allocated by cs_new() */
static inline void cs_free(struct conn_stream *cs)
{
- pool_free2(pool2_connstream, cs);
+ pool_free(pool_head_connstream, cs);
}
/* Tries to allocate a new conn_stream and initialize its main fields. If
* <conn> is NULL, then a new connection is allocated on the fly, initialized,
* and assigned to cs->conn ; this connection will then have to be released
- * using pool_free2() or conn_free(). The conn_stream is initialized and added
+ * using pool_free() or conn_free(). The conn_stream is initialized and added
* to the mux's stream list on success, then returned. On failure, nothing is
* allocated and NULL is returned.
*/
@@ -671,7 +671,7 @@
{
struct conn_stream *cs;
- cs = pool_alloc2(pool2_connstream);
+ cs = pool_alloc(pool_head_connstream);
if (!likely(cs))
return NULL;
@@ -691,7 +691,7 @@
/* Releases a connection previously allocated by conn_new() */
static inline void conn_free(struct connection *conn)
{
- pool_free2(pool2_connection, conn);
+ pool_free(pool_head_connection, conn);
}
/* Release a conn_stream, and kill the connection if it was the last one */
diff --git a/include/proto/filters.h b/include/proto/filters.h
index 0d3e9ac..1be1637 100644
--- a/include/proto/filters.h
+++ b/include/proto/filters.h
@@ -93,7 +93,7 @@
FLT_STRM_DATA_CB_IMPL_2(strm, chn, call, ##__VA_ARGS__), \
FLT_STRM_DATA_CB_IMPL_1(strm, chn, call, ##__VA_ARGS__))
-extern struct pool_head *pool2_filter;
+extern struct pool_head *pool_head_filter;
void flt_deinit(struct proxy *p);
int flt_check(struct proxy *p);
diff --git a/include/proto/hdr_idx.h b/include/proto/hdr_idx.h
index 0536444..f65b3c6 100644
--- a/include/proto/hdr_idx.h
+++ b/include/proto/hdr_idx.h
@@ -25,7 +25,7 @@
#include <common/config.h>
#include <types/hdr_idx.h>
-extern struct pool_head *pool2_hdr_idx;
+extern struct pool_head *pool_head_hdr_idx;
/*
* Initialize the list pointers.
diff --git a/include/proto/log.h b/include/proto/log.h
index 95c1701..c92217c 100644
--- a/include/proto/log.h
+++ b/include/proto/log.h
@@ -34,8 +34,8 @@
#include <types/proxy.h>
#include <types/stream.h>
-extern struct pool_head *pool2_requri;
-extern struct pool_head *pool2_uniqueid;
+extern struct pool_head *pool_head_requri;
+extern struct pool_head *pool_head_uniqueid;
extern char *log_format;
extern char default_tcp_log_format[];
diff --git a/include/proto/queue.h b/include/proto/queue.h
index 19212d4..f66d809 100644
--- a/include/proto/queue.h
+++ b/include/proto/queue.h
@@ -34,7 +34,7 @@
#include <proto/backend.h>
-extern struct pool_head *pool2_pendconn;
+extern struct pool_head *pool_head_pendconn;
int init_pendconn();
struct pendconn *pendconn_add(struct stream *strm);
diff --git a/include/proto/session.h b/include/proto/session.h
index 7f95e2a..d63d29e 100644
--- a/include/proto/session.h
+++ b/include/proto/session.h
@@ -32,7 +32,7 @@
#include <proto/stick_table.h>
-extern struct pool_head *pool2_session;
+extern struct pool_head *pool_head_session;
struct session *session_new(struct proxy *fe, struct listener *li, enum obj_type *origin);
void session_free(struct session *sess);
int init_session();
diff --git a/include/proto/signal.h b/include/proto/signal.h
index 32f6ce6..063683f 100644
--- a/include/proto/signal.h
+++ b/include/proto/signal.h
@@ -20,7 +20,7 @@
extern int signal_queue_len;
extern struct signal_descriptor signal_state[];
-extern struct pool_head *pool2_sig_handlers;
+extern struct pool_head *pool_head_sig_handlers;
__decl_hathreads(extern HA_SPINLOCK_T signals_lock);
diff --git a/include/proto/stream.h b/include/proto/stream.h
index 1a31930..938c58d 100644
--- a/include/proto/stream.h
+++ b/include/proto/stream.h
@@ -30,7 +30,7 @@
#include <proto/stick_table.h>
#include <proto/task.h>
-extern struct pool_head *pool2_stream;
+extern struct pool_head *pool_head_stream;
extern struct list streams;
extern struct data_cb sess_conn_cb;
diff --git a/include/proto/task.h b/include/proto/task.h
index 7639ed7..4291482 100644
--- a/include/proto/task.h
+++ b/include/proto/task.h
@@ -88,8 +88,8 @@
extern unsigned int tasks_run_queue_cur;
extern unsigned int nb_tasks_cur;
extern unsigned int niced_tasks; /* number of niced tasks in the run queue */
-extern struct pool_head *pool2_task;
-extern struct pool_head *pool2_notification;
+extern struct pool_head *pool_head_task;
+extern struct pool_head *pool_head_notification;
__decl_hathreads(extern HA_SPINLOCK_T rq_lock); /* spin lock related to run queue */
__decl_hathreads(extern HA_SPINLOCK_T wq_lock); /* spin lock related to wait queue */
@@ -218,7 +218,7 @@
*/
static inline struct task *task_new(unsigned long thread_mask)
{
- struct task *t = pool_alloc2(pool2_task);
+ struct task *t = pool_alloc(pool_head_task);
if (t) {
HA_ATOMIC_ADD(&nb_tasks, 1);
task_init(t, thread_mask);
@@ -232,9 +232,9 @@
*/
static inline void task_free(struct task *t)
{
- pool_free2(pool2_task, t);
+ pool_free(pool_head_task, t);
if (unlikely(stopping))
- pool_flush2(pool2_task);
+ pool_flush(pool_head_task);
HA_ATOMIC_SUB(&nb_tasks, 1);
}
@@ -291,7 +291,7 @@
*/
static inline struct notification *notification_new(struct list *purge, struct list *event, struct task *wakeup)
{
- struct notification *com = pool_alloc2(pool2_notification);
+ struct notification *com = pool_alloc(pool_head_notification);
if (!com)
return NULL;
LIST_ADDQ(purge, &com->purge_me);
@@ -315,7 +315,7 @@
LIST_DEL(&com->purge_me);
if (!com->task) {
HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock);
- pool_free2(pool2_notification, com);
+ pool_free(pool_head_notification, com);
continue;
}
com->task = NULL;
@@ -337,7 +337,7 @@
LIST_DEL(&com->wake_me);
if (!com->task) {
HA_SPIN_UNLOCK(NOTIF_LOCK, &com->lock);
- pool_free2(pool2_notification, com);
+ pool_free(pool_head_notification, com);
continue;
}
task_wakeup(com->task, TASK_WOKEN_MSG);