MEDIUM: poller: program the update in fd_update_events() for a migrated FD
When an FD is migrated, all pollers program an update. That's useless
code duplication, and when thread groups will be supported, this will
require an extra round of locking just to verify the update_mask on
return. Let's just program the update direction from fd_update_events()
as it already does for closed FDs, this becomes more logical.
diff --git a/src/ev_epoll.c b/src/ev_epoll.c
index 1917ed1..354a187 100644
--- a/src/ev_epoll.c
+++ b/src/ev_epoll.c
@@ -214,7 +214,6 @@
for (count = 0; count < status; count++) {
unsigned int n, e;
- int ret;
e = epoll_events[count].events;
fd = epoll_events[count].data.fd;
@@ -231,13 +230,7 @@
((e & EPOLLHUP) ? FD_EV_SHUT_RW : 0) |
((e & EPOLLERR) ? FD_EV_ERR_RW : 0);
- ret = fd_update_events(fd, n);
-
- if (ret == FD_UPDT_MIGRATED) {
- /* FD has been migrated */
- if (!HA_ATOMIC_BTS(&fdtab[fd].update_mask, tid))
- fd_updt[fd_nbupdt++] = fd;
- }
+ fd_update_events(fd, n);
}
/* the caller will take care of cached events */
}