[RFC PATCH net-next 4/4] net/ipv6: use rhashtable length helper

From
Pedro Tammela <hidden>
Date
2023-06-09 15:14:01
Reply to
Pedro Tammela, 2023-06-09
Avoid open coding the rhashtab length read

Signed-off-by: Pedro Tammela <redacted>
---
 net/ipv6/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index e20b3705c2d2..402e4f6f9e25 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -25,6 +25,7 @@
 #include <net/udp.h>
 #include <net/transp_v6.h>
 #include <net/ipv6.h>
+#include <linux/rhashtable.h>
 
 #define MAX4(a, b, c, d) \
 	max_t(u32, max_t(u32, a, b), max_t(u32, c, d))
@@ -44,7 +45,7 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
 	seq_printf(seq, "RAW6: inuse %d\n",
 		       sock_prot_inuse_get(net, &rawv6_prot));
 	seq_printf(seq, "FRAG6: inuse %u memory %lu\n",
-		   atomic_read(&net->ipv6.fqdir->rhashtable.nelems),
+		   rhashtable_len(&net->ipv6.fqdir->rhashtable),
 		   frag_mem_limit(net->ipv6.fqdir));
 	return 0;
 }
-- 
2.39.2
Thread (9 messages) 9 messages, 3 authors, last reply 2023-06-09
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help