summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_cache.h
diff options
context:
space:
mode:
authorAndrew Clayton <a.clayton@nginx.com>2023-03-27 19:28:54 +0100
committerAndrew Clayton <a.clayton@nginx.com>2023-04-24 19:39:09 +0100
commitb9177d36e71a9f62198b00fa40f277c06d2264bb (patch)
tree3941280ca6ab849457ba17a75afb4cc7feb183bc /src/nxt_cache.h
parent6f36a67fc37004511299133e39d9a6fbb9d55a0c (diff)
downloadunit-b9177d36e71a9f62198b00fa40f277c06d2264bb.tar.gz
unit-b9177d36e71a9f62198b00fa40f277c06d2264bb.tar.bz2
Remove a bunch of dead code.
This removes a bunch of unused files that would have been touched by subsequent commits that switch to using nxt_bool_t (AKA unit6_t) in structures. In auto/sources we have NXT_LIB_SRC0=" \ src/nxt_buf_filter.c \ src/nxt_job_file.c \ src/nxt_stream_module.c \ src/nxt_stream_source.c \ src/nxt_upstream_source.c \ src/nxt_http_source.c \ src/nxt_fastcgi_source.c \ src/nxt_fastcgi_record_parse.c \ \ src/nxt_mem_pool_cleanup.h \ src/nxt_mem_pool_cleanup.c \ " None of these seem to actually be used anywhere (other than within themselves). That variable is _not_ referenced anywhere else. Also remove the unused related header files: src/nxt_buf_filter.h, src/nxt_fastcgi_source.h, src/nxt_http_source.h, src/nxt_job_file.h, src/nxt_stream_source.h and src/nxt_upstream_source.h Also, these files do not seem to be used, no mention under auto/ or build/ src/nxt_file_cache.c src/nxt_cache.c src/nxt_job_file_cache.c src/nxt_cache.h is #included in src/nxt_main.h, but AFAICT is not actually used. With all the above removed $ ./configure --openssl --debug --tests && make -j && make -j tests && make libnxt all builds. Buildbot passes. NOTE: You may need to do a 'make clean' before the next build attempt. Reviewed-by: Alejandro Colomar <alx@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
Diffstat (limited to '')
-rw-r--r--src/nxt_cache.h122
1 files changed, 0 insertions, 122 deletions
diff --git a/src/nxt_cache.h b/src/nxt_cache.h
deleted file mode 100644
index 567b5581..00000000
--- a/src/nxt_cache.h
+++ /dev/null
@@ -1,122 +0,0 @@
-
-/*
- * Copyright (C) Igor Sysoev
- * Copyright (C) NGINX, Inc.
- */
-
-#ifndef _NXT_CACHE_INCLUDED_
-#define _NXT_CACHE_INCLUDED_
-
-
-typedef struct nxt_cache_query_s nxt_cache_query_t;
-typedef struct nxt_cache_query_wait_s nxt_cache_query_wait_t;
-
-
-typedef struct {
- uint32_t shared; /* 1 bit */
- nxt_thread_spinlock_t lock;
-
- nxt_lvlhsh_t lvlhsh;
- const nxt_lvlhsh_proto_t *proto;
- void *pool;
-
- nxt_queue_t expiry_queue;
-
- nxt_queue_t free_nodes;
- uint32_t nfree_nodes;
-
- uint32_t nfree_query_wait;
- nxt_cache_query_wait_t *free_query_wait;
-
- uint64_t start_time;
-
- /* STUB: use nxt_lvlhsh_proto_t */
- void *(*alloc)(void *data, size_t size);
- void (*free)(void *data, void *p);
- void *data;
-
- nxt_work_handler_t delete_handler;
-} nxt_cache_t;
-
-
-typedef struct {
- u_char *key_data;
-
- uint16_t key_len; /* 16 bits */
- uint8_t uses; /* 8 bits */
- uint8_t updating:1;
- uint8_t deleted:1;
-
- uint32_t count;
-
- /* Times relative to the cache->start_time. */
- uint32_t expiry;
- uint32_t accessed;
-
- nxt_off_t size;
-
- nxt_queue_link_t link;
-
- nxt_cache_query_wait_t *waiting;
-} nxt_cache_node_t;
-
-
-struct nxt_cache_query_wait_s {
- nxt_cache_query_t *query;
- nxt_cache_query_wait_t *next;
-
- uint8_t busy; /* 1 bit */
- uint8_t deleted; /* 1 bit */
-
- nxt_pid_t pid;
- nxt_event_engine_t *engine;
- nxt_work_handler_t handler;
- nxt_cache_t *cache;
-};
-
-
-typedef struct {
- nxt_work_handler_t nocache_handler;
- nxt_work_handler_t ready_handler;
- nxt_work_handler_t stale_handler;
- nxt_work_handler_t update_stale_handler;
- nxt_work_handler_t update_handler;
- nxt_work_handler_t timeout_handler;
- nxt_work_handler_t error_handler;
-} nxt_cache_query_state_t;
-
-
-struct nxt_cache_query_s {
- u_char *key_data;
-
- uint16_t key_len; /* 16 bits */
-#if (NXT_64_BIT)
- uint8_t hold; /* 1 bit */
- uint8_t use_stale; /* 1 bit */
- uint8_t update_stale; /* 1 bit */
- uint8_t stale; /* 1 bit */
-#else
- uint8_t hold:1;
- uint8_t use_stale:1;
- uint8_t update_stale:1;
- uint8_t stale:1;
-#endif
-
- nxt_cache_node_t *node;
- nxt_cache_query_t *next;
- nxt_cache_query_state_t *state;
-
- nxt_time_t now;
-
- nxt_msec_t timeout;
- nxt_timer_t timer;
-};
-
-
-NXT_EXPORT void nxt_cache_init(nxt_cache_t *cache);
-NXT_EXPORT void nxt_cache_query(nxt_cache_t *cache, nxt_cache_query_t *q);
-NXT_EXPORT void nxt_cache_release(nxt_cache_t *cache, nxt_cache_query_t *q);
-NXT_EXPORT nxt_int_t nxt_cache_update(nxt_cache_t *cache, nxt_cache_query_t *q);
-
-
-#endif /* _NXT_CACHE_INCLUDED_ */