REORG: polling: rename "fd_spec" to "fd_cache"
So fd_spec was renamed "fd_cache" as it's becoming an event cache, and
fd_nbspec becomes fd_cache_num.
diff --git a/include/proto/fd.h b/include/proto/fd.h
index 3563a08..ba08260 100644
--- a/include/proto/fd.h
+++ b/include/proto/fd.h
@@ -31,10 +31,10 @@
#include <types/fd.h>
/* public variables */
-extern int fd_nbspec; // number of speculative events in the list
-extern int fd_nbupdt; // number of updates in the list
-extern unsigned int *fd_spec; // speculative I/O list
-extern unsigned int *fd_updt; // FD updates list
+extern unsigned int *fd_cache; // FD events cache
+extern unsigned int *fd_updt; // FD updates list
+extern int fd_cache_num; // number of events in the cache
+extern int fd_nbupdt; // number of updates in the list
/* Deletes an FD from the fdsets, and recomputes the maxfd limit.
* The file descriptor is also closed.
@@ -100,9 +100,9 @@
if (fdtab[fd].cache)
/* FD already in speculative I/O list */
return;
- fd_nbspec++;
- fdtab[fd].cache = fd_nbspec;
- fd_spec[fd_nbspec-1] = fd;
+ 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
@@ -117,11 +117,11 @@
if (!pos)
return;
fdtab[fd].cache = 0;
- fd_nbspec--;
- if (likely(pos <= fd_nbspec)) {
+ fd_cache_num--;
+ if (likely(pos <= fd_cache_num)) {
/* was not the last entry */
- fd = fd_spec[fd_nbspec];
- fd_spec[pos - 1] = fd;
+ fd = fd_cache[fd_cache_num];
+ fd_cache[pos - 1] = fd;
fdtab[fd].cache = pos;
}
}