From: Willy Tarreau Date: Sat, 20 Jan 2018 22:59:40 +0000 (+0100) Subject: CLEANUP: fd: remove the unused "new" field X-Git-Tag: v1.9-dev1~476 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=745c60eac6f70d79a30ba8c4cbb8ede4dd3450ef;p=thirdparty%2Fhaproxy.git CLEANUP: fd: remove the unused "new" field This field has been unused since 1.6, it's only updated and never tested. Let's remove it. --- diff --git a/include/proto/fd.h b/include/proto/fd.h index c9449ff868..5885d0cc9c 100644 --- a/include/proto/fd.h +++ b/include/proto/fd.h @@ -398,7 +398,6 @@ static inline void fd_insert(int fd, unsigned long thread_mask) { HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); fdtab[fd].ev = 0; - fdtab[fd].new = 1; fdtab[fd].update_mask &= ~tid_bit; fdtab[fd].linger_risk = 0; fdtab[fd].cloned = 0; diff --git a/include/types/fd.h b/include/types/fd.h index da9f31eddb..e04ea675f8 100644 --- a/include/types/fd.h +++ b/include/types/fd.h @@ -101,7 +101,6 @@ struct fdtab { unsigned int cache; /* position+1 in the FD cache. 0=not in cache. */ unsigned char state; /* FD state for read and write directions (2*3 bits) */ unsigned char ev; /* event seen in return of poll() : FD_POLL_* */ - unsigned char new:1; /* 1 if this fd has just been created */ unsigned char linger_risk:1; /* 1 if we must kill lingering before closing */ unsigned char cloned:1; /* 1 if a cloned socket, requires EPOLL_CTL_DEL on close */ }; diff --git a/src/cli.c b/src/cli.c index cff59f28ac..ed8cc5bff5 100644 --- a/src/cli.c +++ b/src/cli.c @@ -794,7 +794,7 @@ static int cli_io_handler_show_fd(struct appctx *appctx) li = fdt.owner; chunk_printf(&trash, - " %5d : st=0x%02x(R:%c%c%c W:%c%c%c) ev=0x%02x(%c%c%c%c%c) [%c%c%c] cache=%u owner=%p iocb=%p(%s) tmask=0x%lx umask=0x%lx", + " %5d : st=0x%02x(R:%c%c%c W:%c%c%c) ev=0x%02x(%c%c%c%c%c) [%c%c] cache=%u owner=%p iocb=%p(%s) tmask=0x%lx umask=0x%lx", fd, fdt.state, (fdt.state & FD_EV_POLLED_R) ? 'P' : 'p', @@ -809,7 +809,6 @@ static int cli_io_handler_show_fd(struct appctx *appctx) (fdt.ev & FD_POLL_OUT) ? 'O' : 'o', (fdt.ev & FD_POLL_PRI) ? 'P' : 'p', (fdt.ev & FD_POLL_IN) ? 'I' : 'i', - fdt.new ? 'N' : 'n', fdt.linger_risk ? 'L' : 'l', fdt.cloned ? 'C' : 'c', fdt.cache, diff --git a/src/ev_epoll.c b/src/ev_epoll.c index baa6770181..0dd908dbcd 100644 --- a/src/ev_epoll.c +++ b/src/ev_epoll.c @@ -81,8 +81,6 @@ REGPRM2 static void _do_poll(struct poller *p, int exp) HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); fdtab[fd].update_mask &= ~tid_bit; - fdtab[fd].new = 0; - eo = fdtab[fd].state; en = fd_compute_new_polled_status(eo); fdtab[fd].state = en; diff --git a/src/ev_kqueue.c b/src/ev_kqueue.c index 0346ec4ef1..6169e63cea 100644 --- a/src/ev_kqueue.c +++ b/src/ev_kqueue.c @@ -54,8 +54,6 @@ REGPRM2 static void _do_poll(struct poller *p, int exp) HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); fdtab[fd].update_mask &= ~tid_bit; - fdtab[fd].new = 0; - eo = fdtab[fd].state; en = fd_compute_new_polled_status(eo); fdtab[fd].state = en; diff --git a/src/ev_poll.c b/src/ev_poll.c index 2460a67132..715314cda9 100644 --- a/src/ev_poll.c +++ b/src/ev_poll.c @@ -84,8 +84,6 @@ REGPRM2 static void _do_poll(struct poller *p, int exp) HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); fdtab[fd].update_mask &= ~tid_bit; - fdtab[fd].new = 0; - eo = fdtab[fd].state; en = fd_compute_new_polled_status(eo); fdtab[fd].state = en; diff --git a/src/ev_select.c b/src/ev_select.c index 9d53a8502e..2a62ba92ce 100644 --- a/src/ev_select.c +++ b/src/ev_select.c @@ -66,8 +66,6 @@ REGPRM2 static void _do_poll(struct poller *p, int exp) HA_SPIN_LOCK(FD_LOCK, &fdtab[fd].lock); fdtab[fd].update_mask &= ~tid_bit; - fdtab[fd].new = 0; - eo = fdtab[fd].state; en = fd_compute_new_polled_status(eo); fdtab[fd].state = en; diff --git a/src/fd.c b/src/fd.c index 9398364e48..a47b61ad8a 100644 --- a/src/fd.c +++ b/src/fd.c @@ -198,7 +198,6 @@ static void fd_dodelete(int fd, int do_close) fdinfo[fd].port_range = NULL; fdtab[fd].owner = NULL; fdtab[fd].update_mask &= ~tid_bit; - fdtab[fd].new = 0; fdtab[fd].thread_mask = 0; if (do_close) { fdtab[fd].polled_mask = 0;