Avoid open coding the rhashtable length read
Signed-off-by: Pedro Tammela <redacted>
---
net/ipv4/proc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index eaf1d3113b62..cab1edc3c416 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -42,6 +42,7 @@
#include <linux/export.h>
#include <net/sock.h>
#include <net/raw.h>
+#include <linux/rhashtable.h>
#define TCPUDP_MIB_MAX max_t(u32, UDP_MIB_MAX, TCP_MIB_MAX)
@@ -69,7 +70,7 @@ static int sockstat_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "RAW: inuse %d\n",
sock_prot_inuse_get(net, &raw_prot));
seq_printf(seq, "FRAG: inuse %u memory %lu\n",
- atomic_read(&net->ipv4.fqdir->rhashtable.nelems),
+ rhashtable_len(&net->ipv4.fqdir->rhashtable),
frag_mem_limit(net->ipv4.fqdir));
return 0;
}
--
2.39.2