]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
REORG: polling: rename the cache allocation functions
authorWilly Tarreau <w@1wt.eu>
Sat, 25 Jan 2014 18:20:35 +0000 (19:20 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 25 Jan 2014 23:42:29 +0000 (00:42 +0100)
- alloc_spec_entry() becomes fd_alloc_cache_entry()
- release_spec_entry() becomes fd_release_cache_entry()

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

index ba082608c1fccc8f8961216ff2282bae9759f93a..897c2d357a8e7881ca2a521ab966eb6a3ea64acf 100644 (file)
@@ -94,22 +94,23 @@ static inline void updt_fd(const int fd)
 }
 
 
-/* allocate an entry for a speculative event. This can be done at any time. */
-static inline void alloc_spec_entry(const int fd)
+/* Allocates a cache entry for a file descriptor if it does not yet have one.
+ * This can be done at any time.
+ */
+static inline void fd_alloc_cache_entry(const int fd)
 {
        if (fdtab[fd].cache)
-               /* FD already in speculative I/O list */
                return;
        fd_cache_num++;
        fdtab[fd].cache = fd_cache_num;
        fd_cache[fd_cache_num-1] = fd;
 }
 
-/* Removes entry used by fd <fd> from the spec list and replaces it with the
- * last one. The fdtab.spec is adjusted to match the back reference if needed.
+/* Removes entry used by fd <fd> from the FD cache and replaces it with the
+ * last one. The fdtab.cache is adjusted to match the back reference if needed.
  * If the fd has no entry assigned, return immediately.
  */
-static inline void release_spec_entry(int fd)
+static inline void fd_release_cache_entry(int fd)
 {
        unsigned int pos;
 
index 45f7ceabe39de1710ab87e394b1854f128de1815..a15cfc3ddf4af954950ecb59d5290eb5f04208d0 100644 (file)
@@ -96,13 +96,12 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                                /* This fd doesn't use any active entry anymore, we can
                                 * kill its entry.
                                 */
-                               release_spec_entry(fd);
+                               fd_release_cache_entry(fd);
                        }
                        else if ((en & ~eo) & FD_EV_ACTIVE_RW) {
-                               /* we need a new spec entry now */
-                               alloc_spec_entry(fd);
+                               /* we need a new cache entry now */
+                               fd_alloc_cache_entry(fd);
                        }
-
                }
                fdtab[fd].updated = 0;
                fdtab[fd].new = 0;
index 3aa3fd164f7057ede90cca3b411abec18f549110..af5698beece20f262abc3ddf038068de23c33b97 100644 (file)
@@ -85,13 +85,12 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                                /* This fd doesn't use any active entry anymore, we can
                                 * kill its entry.
                                 */
-                               release_spec_entry(fd);
+                               fd_release_cache_entry(fd);
                        }
                        else if ((en & ~eo) & FD_EV_ACTIVE_RW) {
-                               /* we need a new spec entry now */
-                               alloc_spec_entry(fd);
+                               /* we need a new cache entry now */
+                               fd_alloc_cache_entry(fd);
                        }
-
                }
                fdtab[fd].updated = 0;
                fdtab[fd].new = 0;
index 6d550a6a82adcc0eb02a49a843ef50081bf19f51..eff900714c31758b50512584dae33a282017ad39 100644 (file)
@@ -93,13 +93,12 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                                /* This fd doesn't use any active entry anymore, we can
                                 * kill its entry.
                                 */
-                               release_spec_entry(fd);
+                               fd_release_cache_entry(fd);
                        }
                        else if ((en & ~eo) & FD_EV_ACTIVE_RW) {
-                               /* we need a new spec entry now */
-                               alloc_spec_entry(fd);
+                               /* we need a new cache entry now */
+                               fd_alloc_cache_entry(fd);
                        }
-
                }
                fdtab[fd].updated = 0;
                fdtab[fd].new = 0;
index f79cdbfe8c081f55e5a2f5c97c5c19d3c39f4e3b..df1d1615c3b9699a70c73f49f1ddef7e87c78d74 100644 (file)
@@ -76,13 +76,12 @@ REGPRM2 static void _do_poll(struct poller *p, int exp)
                                /* This fd doesn't use any active entry anymore, we can
                                 * kill its entry.
                                 */
-                               release_spec_entry(fd);
+                               fd_release_cache_entry(fd);
                        }
                        else if ((en & ~eo) & FD_EV_ACTIVE_RW) {
-                               /* we need a new spec entry now */
-                               alloc_spec_entry(fd);
+                               /* we need a new cache entry now */
+                               fd_alloc_cache_entry(fd);
                        }
-
                }
                fdtab[fd].updated = 0;
                fdtab[fd].new = 0;
index d2638d3bbd4b6d3fc21ffd0e2c7cfc9ef64c2ca4..f3d63d92b18aa0f2e36f95962f0c9945fca07798 100644 (file)
--- a/src/fd.c
+++ b/src/fd.c
@@ -123,7 +123,7 @@ void fd_delete(int fd)
        if (cur_poller.clo)
                cur_poller.clo(fd);
 
-       release_spec_entry(fd);
+       fd_release_cache_entry(fd);
        fdtab[fd].state &= ~(FD_EV_CURR_MASK | FD_EV_PREV_MASK);
 
        port_range_release_port(fdinfo[fd].port_range, fdinfo[fd].local_port);