Commit 7b421d6f authored by Geoff Simmons's avatar Geoff Simmons

remove the fd table

parent abc22cab
......@@ -78,25 +78,6 @@
#define DISPATCH_CONTINUE 0
#define DISPATCH_TERMINATE 7
typedef enum {
FD_EMPTY = 0,
FD_OPEN
} fd_state_e;
typedef struct fd_t {
unsigned magic;
#define FD_MAGIC 0xa06b2960
logline_t *ll;
fd_state_e state;
double t;
VTAILQ_ENTRY(fd_t) insert_list;
} fd_t;
static fd_t *fd_tbl;
VTAILQ_HEAD(insert_head_s, fd_t);
static struct insert_head_s insert_head = VTAILQ_HEAD_INITIALIZER(insert_head);
static unsigned open = 0, occ_hi = 0, len_hi = 0;
static unsigned long seen = 0, submitted = 0, not_logged = 0,
......@@ -263,16 +244,6 @@ submit(tx_t *tx)
submitted++;
}
static inline void
fd_free(fd_t *entry)
{
CHECK_OBJ_NOTNULL(entry, FD_MAGIC);
VTAILQ_REMOVE(&insert_head, entry, insert_list);
entry->state = FD_EMPTY;
entry->ll = NULL;
open--;
}
static int
event(struct VSL_data *_vsl, struct VSL_transaction * const pt[], void *priv)
{
......@@ -642,17 +613,6 @@ main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
fd_tbl = (fd_t *) calloc(config.max_fd, sizeof(fd_t));
if (fd_tbl == NULL) {
LOG_Log(LOG_ALERT, "Cannot init fd table: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
for (int k = 0; k < config.max_fd; k++) {
fd_tbl[k].magic = FD_MAGIC;
fd_tbl[k].ll = NULL;
fd_tbl[k].state = FD_EMPTY;
}
AZ(pthread_cond_init(&data_ready_cond, NULL));
AZ(pthread_mutex_init(&data_ready_lock, NULL));
AZ(pthread_cond_init(&spscq_ready_cond, NULL));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment