]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MAJOR: polling: remove unused callbacks from the poller struct
authorWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2012 20:02:34 +0000 (21:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 11 Nov 2012 20:02:34 +0000 (21:02 +0100)
Since no poller uses poller->{set,clr,wai,is_set,rem} anymore, let's
remove them and remove the associated pointer tests in proto/fd.h.

include/proto/fd.h
include/types/fd.h
src/ev_epoll.c
src/ev_kqueue.c
src/ev_poll.c
src/ev_select.c

index e72c43ff8dd92b78a756592c19144051327852bb..127cbe08d522d93b325a341aa6654d28ae8b9ba5 100644 (file)
@@ -130,8 +130,6 @@ static inline void release_spec_entry(int fd)
  */
 static inline int fd_ev_is_set(const int fd, int dir)
 {
-       if (cur_poller.is_set)
-               return cur_poller.is_set(fd, dir);
        return ((unsigned)fdtab[fd].spec_e >> dir) & FD_EV_STATUS;
 }
 
@@ -189,50 +187,36 @@ static inline void fd_ev_rem(const int fd)
 /* event manipulation primitives for use by I/O callbacks */
 static inline void fd_want_recv(int fd)
 {
-       if (cur_poller.set)
-               return cur_poller.set(fd, DIR_RD);
        return fd_ev_set(fd, DIR_RD);
 }
 
 static inline void fd_stop_recv(int fd)
 {
-       if (cur_poller.clr)
-               return cur_poller.clr(fd, DIR_RD);
        return fd_ev_clr(fd, DIR_RD);
 }
 
 static inline void fd_poll_recv(int fd)
 {
-       if (cur_poller.wai)
-               return cur_poller.wai(fd, DIR_RD);
        return fd_ev_wai(fd, DIR_RD);
 }
 
 static inline void fd_want_send(int fd)
 {
-       if (cur_poller.set)
-               return cur_poller.set(fd, DIR_WR);
        return fd_ev_set(fd, DIR_WR);
 }
 
 static inline void fd_stop_send(int fd)
 {
-       if (cur_poller.clr)
-               return cur_poller.clr(fd, DIR_WR);
        return fd_ev_clr(fd, DIR_WR);
 }
 
 static inline void fd_poll_send(int fd)
 {
-       if (cur_poller.wai)
-               return cur_poller.wai(fd, DIR_WR);
        return fd_ev_wai(fd, DIR_WR);
 }
 
 static inline void fd_stop_both(int fd)
 {
-       if (cur_poller.rem)
-               return cur_poller.rem(fd);
        return fd_ev_rem(fd);
 }
 
index fab0c6c64a72df9856d01cd320bfd6ee649f8619..56a8c5c28bfab771422d12669e9839a1bc1c6448 100644 (file)
@@ -92,18 +92,12 @@ struct fdinfo {
  *    poller should set it to 100.
  *  - <private> is initialized by the poller's init() function, and cleaned by
  *    the term() function.
- *  - clo() should be used to do indicate the poller that fd will be closed. It
- *    may be the same as rem() on some pollers.
+ *  - clo() should be used to do indicate the poller that fd will be closed.
  *  - poll() calls the poller, expiring at <exp>
  */
 struct poller {
        void   *private;                                     /* any private data for the poller */
-       int  REGPRM2 (*is_set)(const int fd, int dir);       /* check if <fd> is being polled for dir <dir> */
-       void REGPRM2    (*set)(const int fd, int dir);       /* set   polling on <fd> for <dir> */
-       void REGPRM2    (*clr)(const int fd, int dir);       /* clear polling on <fd> for <dir> */
-       void REGPRM2    (*wai)(const int fd, int dir);       /* wait for polling on <fd> for <dir> */
-       void REGPRM1    (*rem)(const int fd);                /* remove any polling on <fd> */
-       void REGPRM1    (*clo)(const int fd);                /* mark <fd> as closed */
+       void REGPRM1   (*clo)(const int fd);                 /* mark <fd> as closed */
        void REGPRM2   (*poll)(struct poller *p, int exp);   /* the poller itself */
        int  REGPRM1   (*init)(struct poller *p);            /* poller initialization */
        void REGPRM1   (*term)(struct poller *p);            /* termination of this poller */
index 62718d650712448db8733d4c47b47604df7606c6..870da105de38ab9911ca080faf4f987708773e42 100644 (file)
@@ -309,18 +309,12 @@ static void _do_register(void)
        p->pref = 300;
        p->private = NULL;
 
+       p->clo  = NULL;
        p->test = _do_test;
        p->init = _do_init;
        p->term = _do_term;
        p->poll = _do_poll;
        p->fork = _do_fork;
-
-       p->is_set  = NULL;
-       p->set = NULL;
-       p->wai = NULL;
-       p->clr = NULL;
-       p->rem = NULL;
-       p->clo = NULL;
 }
 
 
index 4ede2ecbc553326aac24c486ee7365e88058b311..54c52c2ec1491394e869275aabdd469c83b48948 100644 (file)
@@ -258,18 +258,12 @@ static void _do_register(void)
        p->pref = 300;
        p->private = NULL;
 
+       p->clo  = NULL;
        p->test = _do_test;
        p->init = _do_init;
        p->term = _do_term;
        p->poll = _do_poll;
        p->fork = _do_fork;
-
-       p->is_set = NULL;
-       p->set = NULL;
-       p->wai = NULL;
-       p->clr = NULL;
-       p->rem = NULL;
-       p->clo = NULL;
 }
 
 
index 7ebb8a25a791fffde82904dabb28a7a897598cc4..2ce4815d6eb8d351cc74bd30305a4cf7d7def344 100644 (file)
@@ -254,16 +254,11 @@ static void _do_register(void)
        p->pref = 200;
        p->private = NULL;
 
+       p->clo  = __fd_clo;
        p->test = _do_test;
        p->init = _do_init;
        p->term = _do_term;
        p->poll = _do_poll;
-       p->is_set = NULL;
-       p->set = NULL;
-       p->wai = NULL;
-       p->clr = NULL;
-       p->rem = NULL;
-       p->clo = __fd_clo;
 }
 
 
index a4fe3d7398334f2925ba8928ffcf72399b3b81c8..0ac74e71d15d3d9a2724c895538f8c092811059d 100644 (file)
@@ -252,16 +252,11 @@ static void _do_register(void)
        p->pref = 150;
        p->private = NULL;
 
+       p->clo  = __fd_clo;
        p->test = _do_test;
        p->init = _do_init;
        p->term = _do_term;
        p->poll = _do_poll;
-       p->is_set = NULL;
-       p->set = NULL;
-       p->wai = NULL;
-       p->clr = NULL;
-       p->rem = NULL;
-       p->clo = __fd_clo;
 }