diff mbox series

[iptables,09/14] nft: Rename have_cache into have_chain_cache

Message ID 20190916165000.18217-10-phil@nwl.cc
State Changes Requested
Delegated to: Pablo Neira
Headers show
Series Improve iptables-nft performance with large rulesets | expand

Commit Message

Phil Sutter Sept. 16, 2019, 4:49 p.m. UTC
Prepare for optional rule cache by renaming the boolean.

Signed-off-by: Phil Sutter <phil@nwl.cc>
---
 iptables/nft.c | 14 +++++++-------
 iptables/nft.h |  2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/iptables/nft.c b/iptables/nft.c
index 820f3392dd495..1483664510518 100644
--- a/iptables/nft.c
+++ b/iptables/nft.c
@@ -891,11 +891,11 @@  static int flush_cache(struct nft_cache *c, const struct builtin_table *tables,
 
 static void flush_chain_cache(struct nft_handle *h, const char *tablename)
 {
-	if (!h->have_cache)
+	if (!h->have_chain_cache)
 		return;
 
 	if (flush_cache(h->cache, h->tables, tablename))
-		h->have_cache = false;
+		h->have_chain_cache = false;
 }
 
 void nft_fini(struct nft_handle *h)
@@ -1601,7 +1601,7 @@  retry:
 	mnl_genid_get(h, &genid_start);
 	fetch_chain_cache(h);
 	fetch_rule_cache(h);
-	h->have_cache = true;
+	h->have_chain_cache = true;
 	mnl_genid_get(h, &genid_stop);
 
 	if (genid_start != genid_stop) {
@@ -1614,7 +1614,7 @@  retry:
 
 void nft_build_cache(struct nft_handle *h)
 {
-	if (!h->have_cache)
+	if (!h->have_chain_cache)
 		__nft_build_cache(h);
 }
 
@@ -1622,7 +1622,7 @@  void nft_fake_cache(struct nft_handle *h)
 {
 	int i;
 
-	if (h->have_cache)
+	if (h->have_chain_cache)
 		return;
 
 	/* fetch tables so conditional table delete logic works */
@@ -1639,7 +1639,7 @@  void nft_fake_cache(struct nft_handle *h)
 		h->cache->table[type].chains = nftnl_chain_list_alloc();
 	}
 	mnl_genid_get(h, &h->nft_genid);
-	h->have_cache = true;
+	h->have_chain_cache = true;
 }
 
 static void __nft_flush_cache(struct nft_handle *h)
@@ -1654,7 +1654,7 @@  static void __nft_flush_cache(struct nft_handle *h)
 
 static void nft_rebuild_cache(struct nft_handle *h)
 {
-	if (h->have_cache)
+	if (h->have_chain_cache)
 		__nft_flush_cache(h);
 
 	__nft_build_cache(h);
diff --git a/iptables/nft.h b/iptables/nft.h
index d9eb30a2a2413..11b2d4e3be6ff 100644
--- a/iptables/nft.h
+++ b/iptables/nft.h
@@ -53,7 +53,7 @@  struct nft_handle {
 	unsigned int		cache_index;
 	struct nft_cache	__cache[2];
 	struct nft_cache	*cache;
-	bool			have_cache;
+	bool			have_chain_cache;
 	bool			restore;
 	bool			noflush;
 	int8_t			config_done;