MEDIUM: fd: remove the FD_EV_POLLED status bit
Since commit 7ac0e35f2 in 1.9-dev1 ("MAJOR: fd: compute the new fd polling
state out of the fd lock") we've started to update the FD POLLED bit a
bit more aggressively. Lately with the removal of the FD cache, this bit
is always equal to the ACTIVE bit. There's no point continuing to watch
it and update it anymore, all it does is create confusion and complicate
the code. One interesting side effect is that it now becomes visible that
all fd_*_{send,recv}() operations systematically call updt_fd_polling(),
except fd_cant_recv()/fd_cant_send() which never saw it change.
diff --git a/src/ev_poll.c b/src/ev_poll.c
index d4a1351..6c5de9b 100644
--- a/src/ev_poll.c
+++ b/src/ev_poll.c
@@ -57,7 +57,7 @@
* don't check the tid_bit. First thread to see the update
* takes it for every other one.
*/
- if (!(en & FD_EV_POLLED_RW)) {
+ if (!(en & FD_EV_ACTIVE_RW)) {
if (!(polled_mask[fd].poll_recv | polled_mask[fd].poll_send)) {
/* fd was not watched, it's still not */
return;
@@ -70,7 +70,7 @@
}
else {
/* OK fd has to be monitored, it was either added or changed */
- if (!(en & FD_EV_POLLED_R)) {
+ if (!(en & FD_EV_ACTIVE_R)) {
hap_fd_clr(fd, fd_evts[DIR_RD]);
if (polled_mask[fd].poll_recv & tid_bit)
_HA_ATOMIC_AND(&polled_mask[fd].poll_recv, ~tid_bit);
@@ -80,7 +80,7 @@
_HA_ATOMIC_OR(&polled_mask[fd].poll_recv, tid_bit);
}
- if (!(en & FD_EV_POLLED_W)) {
+ if (!(en & FD_EV_ACTIVE_W)) {
hap_fd_clr(fd, fd_evts[DIR_WR]);
if (polled_mask[fd].poll_send & tid_bit)
_HA_ATOMIC_AND(&polled_mask[fd].poll_send, ~tid_bit);