Commit 6be547a6 authored by Andi Kleen's avatar Andi Kleen Committed by David S. Miller

inet_diag: Add empty bucket optimization to inet_diag too

Skip quickly over empty buckets in inet_diag.
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6eac5604
......@@ -782,11 +782,15 @@ static int inet_diag_dump(struct sk_buff *skb, struct netlink_callback *cb)
struct sock *sk;
struct hlist_node *node;
num = 0;
if (hlist_empty(&head->chain) && hlist_empty(&head->twchain))
continue;
if (i > s_i)
s_num = 0;
read_lock_bh(lock);
num = 0;
sk_for_each(sk, node, &head->chain) {
struct inet_sock *inet = inet_sk(sk);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment