MINOR: fd: move .et_possible into fdtab[].state
No need to keep this flag apart any more, let's merge it into the global
state.
diff --git a/include/haproxy/fd-t.h b/include/haproxy/fd-t.h
index cfcde39..e60f3b5 100644
--- a/include/haproxy/fd-t.h
+++ b/include/haproxy/fd-t.h
@@ -66,6 +66,7 @@
#define FD_LINGER_RISK_BIT 16 /* must kill lingering before closing */
#define FD_CLONED_BIT 17 /* cloned socket, requires EPOLL_CTL_DEL on close */
#define FD_INITIALIZED_BIT 18 /* init phase was done (e.g. output pipe set non-blocking) */
+#define FD_ET_POSSIBLE_BIT 19 /* edge-triggered is possible on this FD */
/* and flag values */
@@ -103,6 +104,7 @@
#define FD_LINGER_RISK (1U << FD_LINGER_RISK_BIT)
#define FD_CLONED (1U << FD_CLONED_BIT)
#define FD_INITIALIZED (1U << FD_INITIALIZED_BIT)
+#define FD_ET_POSSIBLE (1U << FD_ET_POSSIBLE_BIT)
/* This is the value used to mark a file descriptor as dead. This value is
* negative, this is important so that tests on fd < 0 properly match. It
@@ -151,7 +153,6 @@
void (*iocb)(int fd); /* I/O handler */
void *owner; /* the connection or listener associated with this fd, NULL if closed */
unsigned int state; /* FD state for read and write directions (FD_EV_*) + FD_POLL_* */
- unsigned char et_possible:1; /* 1 if edge-triggered is possible on this FD */
unsigned char exported:1; /* 1 if the FD is exported and must not be closed */
#ifdef DEBUG_FD
unsigned int event_count; /* number of events reported */
diff --git a/include/haproxy/fd.h b/include/haproxy/fd.h
index 11dce3d..ba9bf8c 100644
--- a/include/haproxy/fd.h
+++ b/include/haproxy/fd.h
@@ -433,7 +433,6 @@
fdtab[fd].owner = owner;
fdtab[fd].iocb = iocb;
fdtab[fd].state = 0;
- fdtab[fd].et_possible = 0;
fdtab[fd].exported = 0;
#ifdef DEBUG_FD
fdtab[fd].event_count = 0;
@@ -441,7 +440,7 @@
/* conn_fd_handler should support edge-triggered FDs */
if ((global.tune.options & GTUNE_FD_ET) && fdtab[fd].iocb == sock_conn_iocb)
- fdtab[fd].et_possible = 1;
+ fdtab[fd].state |= FD_ET_POSSIBLE;
fdtab[fd].thread_mask = thread_mask;
/* note: do not reset polled_mask here as it indicates which poller
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index 22ad454..27dbdb2 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -60,7 +60,7 @@
en = fdtab[fd].state;
/* Try to force EPOLLET on FDs that support it */
- if (fdtab[fd].et_possible) {
+ if (fdtab[fd].state & FD_ET_POSSIBLE) {
/* already done ? */
if (polled_mask[fd].poll_recv & polled_mask[fd].poll_send & tid_bit)
return;