CLEANUP: remove now unused channel pool

The channels are now part of the struct session. Their pool is
not needed anymore.
This commit is contained in:
Willy Tarreau 2014-11-27 22:10:04 +01:00
parent 22ec1eadd0
commit a27dc19eda
6 changed files with 4 additions and 23 deletions

View File

@ -2,7 +2,7 @@
* include/proto/channel.h
* Channel management definitions, macros and inline functions.
*
* Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
* Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -28,15 +28,12 @@
#include <common/config.h>
#include <common/chunk.h>
#include <common/memory.h>
#include <common/ticks.h>
#include <common/time.h>
#include <types/channel.h>
#include <types/global.h>
extern struct pool_head *pool2_channel;
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
int init_channel();

View File

@ -2,7 +2,7 @@
* include/types/channel.h
* Channel management definitions, macros and inline functions.
*
* Copyright (C) 2000-2012 Willy Tarreau - w@1wt.eu
* Copyright (C) 2000-2014 Willy Tarreau - w@1wt.eu
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -23,7 +23,6 @@
#define _TYPES_CHANNEL_H
#include <common/config.h>
#include <common/chunk.h>
#include <common/buffer.h>
#include <types/stream_interface.h>
@ -162,8 +161,6 @@
/* Magic value to forward infinite size (TCP, ...), used with ->to_forward */
#define CHN_INFINITE_FORWARD MAX_RANGE(unsigned int)
/* needed for a declaration below */
struct session;
struct channel {
unsigned int flags; /* CF_* */

View File

@ -1,7 +1,7 @@
/*
* Channel management functions.
*
* Copyright 2000-2012 Willy Tarreau <w@1wt.eu>
* Copyright 2000-2014 Willy Tarreau <w@1wt.eu>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -16,20 +16,10 @@
#include <string.h>
#include <common/config.h>
#include <common/memory.h>
#include <common/buffer.h>
#include <proto/channel.h>
struct pool_head *pool2_channel;
/* perform minimal intializations, report 0 in case of error, 1 if OK. */
int init_channel()
{
pool2_channel = create_pool("channel", sizeof(struct channel), MEM_F_SHARED);
return pool2_channel != NULL;
}
/* Schedule up to <bytes> more bytes to be forwarded via the channel without
* notifying the owner task. Any data pending in the buffer are scheduled to be

View File

@ -777,7 +777,6 @@ void init(int argc, char **argv)
global_listener_queue_task->expire = TICK_ETERNITY;
/* now we know the buffer size, we can initialize the channels and buffers */
init_channel();
init_buffer();
if (have_appsession)
@ -1434,7 +1433,6 @@ void deinit(void)
pool_destroy2(pool2_session);
pool_destroy2(pool2_connection);
pool_destroy2(pool2_buffer);
pool_destroy2(pool2_channel);
pool_destroy2(pool2_requri);
pool_destroy2(pool2_task);
pool_destroy2(pool2_capture);

View File

@ -1820,7 +1820,7 @@ __LJMP static int hlua_socket_new(lua_State *L)
memset(socket, 0, sizeof(*socket));
/* Check if the various memory pools are intialized. */
if (!pool2_session || !pool2_channel || !pool2_buffer) {
if (!pool2_session || !pool2_buffer) {
hlua_pusherror(L, "socket: uninitialized pools.");
goto out_fail_conf;
}

View File

@ -661,7 +661,6 @@ static void session_free(struct session *s)
/* We may want to free the maximum amount of pools if the proxy is stopping */
if (fe && unlikely(fe->state == PR_STSTOPPED)) {
pool_flush2(pool2_buffer);
pool_flush2(pool2_channel);
pool_flush2(pool2_hdr_idx);
pool_flush2(pool2_requri);
pool_flush2(pool2_capture);