--------------------- PatchSet 8716 Date: 2006/10/23 11:10:47 Author: hno Branch: commloops-2_6 Tag: (none) Log: Clean up of comm_select_init/shutdown to remove generic stuff from the comm loop implementations Members: src/comm_epoll.c:1.17.2.5->1.17.2.6 src/comm_generic.c:1.2.2.5->1.2.2.6 src/comm_kqueue.c:1.6.2.3->1.6.2.4 src/comm_poll.c:1.14.2.4->1.14.2.5 src/comm_select.c:1.29.2.4->1.29.2.5 Index: squid/src/comm_epoll.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_epoll.c,v retrieving revision 1.17.2.5 retrieving revision 1.17.2.6 diff -u -r1.17.2.5 -r1.17.2.6 --- squid/src/comm_epoll.c 23 Oct 2006 10:42:42 -0000 1.17.2.5 +++ squid/src/comm_epoll.c 23 Oct 2006 11:10:47 -0000 1.17.2.6 @@ -1,6 +1,6 @@ /* - * $Id: comm_epoll.c,v 1.17.2.5 2006/10/23 10:42:42 hno Exp $ + * $Id: comm_epoll.c,v 1.17.2.6 2006/10/23 11:10:47 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -65,10 +65,9 @@ } } -void -comm_select_init() +static void +do_select_init() { - comm_generic_init(); kdpfd = epoll_create(Squid_MaxFD); if (kdpfd < 0) fatalf("comm_select_init: epoll_create(): %s\n", xstrerror()); @@ -84,14 +83,13 @@ debug(5, 1) ("Using epoll for the IO loop\n"); } -void -comm_select_shutdown() +static void +do_select_shutdown() { fd_close(kdpfd); close(kdpfd); kdpfd = -1; safe_free(epoll_state); - comm_generic_shutdown(); } void Index: squid/src/comm_generic.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_generic.c,v retrieving revision 1.2.2.5 retrieving revision 1.2.2.6 diff -u -r1.2.2.5 -r1.2.2.6 --- squid/src/comm_generic.c 23 Oct 2006 10:42:10 -0000 1.2.2.5 +++ squid/src/comm_generic.c 23 Oct 2006 11:10:47 -0000 1.2.2.6 @@ -1,6 +1,6 @@ /* - * $Id: comm_generic.c,v 1.2.2.5 2006/10/23 10:42:10 hno Exp $ + * $Id: comm_generic.c,v 1.2.2.6 2006/10/23 11:10:47 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -44,17 +44,23 @@ static int n_slow_fds = 0; #endif -static void -comm_generic_init(void) +static void do_select_init(void); + +void +comm_select_init(void) { #if DELAY_POOLS slow_fds = xmalloc(sizeof(int) * Squid_MaxFD); #endif + do_select_init(); } -static void -comm_generic_shutdown(void) +static void do_select_shutdown(void); + +void +comm_select_shutdown(void) { + do_select_shutdown(); #if DELAY_POOLS safe_free(slow_fds); #endif Index: squid/src/comm_kqueue.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_kqueue.c,v retrieving revision 1.6.2.3 retrieving revision 1.6.2.4 diff -u -r1.6.2.3 -r1.6.2.4 --- squid/src/comm_kqueue.c 1 Oct 2006 02:00:14 -0000 1.6.2.3 +++ squid/src/comm_kqueue.c 23 Oct 2006 11:10:47 -0000 1.6.2.4 @@ -50,10 +50,9 @@ static int kqoff; /* offset into the buffer */ static unsigned *kqueue_state; /* keep track of the kqueue state */ -void -comm_select_init() +static void +do_select_init() { - comm_generic_init(); kq = kqueue(); if (kq < 0) fatalf("comm_select_init: kqueue(): %s\n", xstrerror()); @@ -72,14 +71,13 @@ debug(5, 1) ("Using kqueue for the IO loop\n"); } -void -comm_select_shutdown() +static void +do_select_shutdown() { fd_close(kq); close(kq); kq = -1; safe_free(kqueue_state); - comm_generic_shutdown(); } void Index: squid/src/comm_poll.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_poll.c,v retrieving revision 1.14.2.4 retrieving revision 1.14.2.5 diff -u -r1.14.2.4 -r1.14.2.5 --- squid/src/comm_poll.c 1 Oct 2006 02:00:14 -0000 1.14.2.4 +++ squid/src/comm_poll.c 23 Oct 2006 11:10:47 -0000 1.14.2.5 @@ -45,11 +45,10 @@ static int *pfd_map; static int nfds = 0; -void -comm_select_init() +static void +do_select_init() { int i; - comm_generic_init(); pfds = xcalloc(sizeof(*pfds), Squid_MaxFD); pfd_map = xcalloc(sizeof(*pfd_map), Squid_MaxFD); for (i = 0; i < Squid_MaxFD; i++) { @@ -63,11 +62,10 @@ debug(5, 1) ("Using poll for the IO loop\n"); } -void -comm_select_shutdown() +static void +do_select_shutdown() { safe_free(pfds); - comm_generic_shutdown(); } void Index: squid/src/comm_select.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/comm_select.c,v retrieving revision 1.29.2.4 retrieving revision 1.29.2.5 diff -u -r1.29.2.4 -r1.29.2.5 --- squid/src/comm_select.c 1 Oct 2006 02:00:14 -0000 1.29.2.4 +++ squid/src/comm_select.c 23 Oct 2006 11:10:48 -0000 1.29.2.5 @@ -1,6 +1,6 @@ /* - * $Id: comm_select.c,v 1.29.2.4 2006/10/01 02:00:14 hno Exp $ + * $Id: comm_select.c,v 1.29.2.5 2006/10/23 11:10:48 hno Exp $ * * DEBUG: section 5 Socket Functions * @@ -55,10 +55,9 @@ static int nreadfds; static int nwritefds; -void -comm_select_init() +static void +do_select_init() { - comm_generic_init(); global_readfds = xcalloc(FD_MASK_BYTES, howmany(Squid_MaxFD, FD_MASK_BITS)); global_writefds = xcalloc(FD_MASK_BYTES, howmany(Squid_MaxFD, FD_MASK_BITS)); current_readfds = xcalloc(FD_MASK_BYTES, howmany(Squid_MaxFD, FD_MASK_BITS)); @@ -72,14 +71,13 @@ debug(5, 1) ("Using select for the IO loop\n"); } -void -comm_select_shutdown() +static void +do_select_shutdown() { safe_free(global_readfds); safe_free(global_writefds); safe_free(current_readfds); safe_free(current_writefds); - comm_generic_shutdown(); } void