diff mbox series

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

Message ID 20230609151332.263152-5-pctammela@mojatatu.com (mailing list archive)
State RFC
Delegated to: Netdev Maintainers
Headers show
Series rhashtable: length helper for rhashtable and rhltable | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next, async
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 15 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Pedro Tammela June 9, 2023, 3:13 p.m. UTC
Avoid open coding the rhashtab length read

Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
---
 net/ipv6/proc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

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;
 }