]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
cache: rename chain_htable to cache_chain_ht
authorPablo Neira Ayuso <pablo@netfilter.org>
Thu, 1 Apr 2021 20:18:29 +0000 (22:18 +0200)
committerPablo Neira Ayuso <pablo@netfilter.org>
Sat, 3 Apr 2021 17:41:02 +0000 (19:41 +0200)
Rename the hashtable chain that is used for fast cache lookups.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
include/rule.h
src/cache.c
src/rule.c

index 4ef24eb4ec63e3420715a5f49c88cfd5ddc743fe..f8e615121113f0a6034780a38c8cd6dcd62f0fd5 100644 (file)
@@ -155,7 +155,7 @@ struct table {
        struct handle           handle;
        struct location         location;
        struct scope            scope;
-       struct list_head        *chain_htable;
+       struct list_head        *cache_chain_ht;
        struct list_head        chains;
        struct list_head        sets;
        struct list_head        objs;
@@ -230,7 +230,7 @@ struct hook_spec {
  */
 struct chain {
        struct list_head        list;
-       struct list_head        hlist;
+       struct list_head        cache_hlist;
        struct handle           handle;
        struct location         location;
        unsigned int            refcnt;
index 63971e865622fd502c5fb1e231393637cd6d918d..400128906b035509e8440444bbc23f7289ed6a97 100644 (file)
@@ -195,7 +195,7 @@ static int chain_cache_cb(struct nftnl_chain *nlc, void *arg)
        if (chain->flags & CHAIN_F_BINDING) {
                list_add_tail(&chain->list, &ctx->table->chain_bindings);
        } else {
-               list_add_tail(&chain->hlist, &ctx->table->chain_htable[hash]);
+               list_add_tail(&chain->cache_hlist, &ctx->table->cache_chain_ht[hash]);
                list_add_tail(&chain->list, &ctx->table->chains);
        }
 
@@ -239,7 +239,7 @@ void chain_cache_add(struct chain *chain, struct table *table)
        uint32_t hash;
 
        hash = djb_hash(chain->handle.chain.name) % NFT_CACHE_HSIZE;
-       list_add_tail(&chain->hlist, &table->chain_htable[hash]);
+       list_add_tail(&chain->cache_hlist, &table->cache_chain_ht[hash]);
        list_add_tail(&chain->list, &table->chains);
 }
 
@@ -250,7 +250,7 @@ struct chain *chain_cache_find(const struct table *table,
        uint32_t hash;
 
        hash = djb_hash(handle->chain.name) % NFT_CACHE_HSIZE;
-       list_for_each_entry(chain, &table->chain_htable[hash], hlist) {
+       list_for_each_entry(chain, &table->cache_chain_ht[hash], cache_hlist) {
                if (!strcmp(chain->handle.chain.name, handle->chain.name))
                        return chain;
        }
index 96931800893332bf1b6866fcc49aa9982f28a49b..79706ab7b60a5f35131f21ada28b750fb2155211 100644 (file)
@@ -1140,10 +1140,10 @@ struct table *table_alloc(void)
        init_list_head(&table->scope.symbols);
        table->refcnt = 1;
 
-       table->chain_htable =
+       table->cache_chain_ht =
                xmalloc(sizeof(struct list_head) * NFT_CACHE_HSIZE);
        for (i = 0; i < NFT_CACHE_HSIZE; i++)
-               init_list_head(&table->chain_htable[i]);
+               init_list_head(&table->cache_chain_ht[i]);
 
        return table;
 }
@@ -1171,7 +1171,7 @@ void table_free(struct table *table)
                obj_free(obj);
        handle_free(&table->handle);
        scope_release(&table->scope);
-       xfree(table->chain_htable);
+       xfree(table->cache_chain_ht);
        xfree(table);
 }