summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2021-07-01 13:06:00 -0700
committerAndrii Nakryiko <andrii@kernel.org>2021-07-23 16:44:53 -0700
commitb72acf4501d7c31e96749f0f5052b3bcb25fc2cb (patch)
tree62d37a764adefd9125a16b2d6d046fb574d5ed19 /include
parent62001372c2b6cdf2346afb2cf94ed3d950eee64c (diff)
downloadlinux-stable-b72acf4501d7c31e96749f0f5052b3bcb25fc2cb.tar.gz
linux-stable-b72acf4501d7c31e96749f0f5052b3bcb25fc2cb.tar.bz2
linux-stable-b72acf4501d7c31e96749f0f5052b3bcb25fc2cb.zip
tcp: seq_file: Add listening_get_first()
The current listening_get_next() is overloaded by passing NULL to the 2nd arg, like listening_get_next(seq, NULL), to mean get_first(). This patch moves some logic from the listening_get_next() into a new function listening_get_first(). It will be equivalent to the current established_get_first() and established_get_next() setup. get_first() is to find a non empty bucket and return the first sk. get_next() is to find the next sk of the current bucket and then resorts to get_first() if the current bucket is exhausted. The next patch is to move the listener seq_file iteration from listening_hash (port only) to lhash2 (port+addr). Separating out listening_get_first() from listening_get_next() here will make the following lhash2 changes cleaner and easier to follow. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Andrii Nakryiko <andrii@kernel.org> Reviewed-by: Eric Dumazet <edumazet@google.com> Acked-by: Kuniyuki Iwashima <kuniyu@amazon.co.jp> Acked-by: Yonghong Song <yhs@fb.com> Link: https://lore.kernel.org/bpf/20210701200600.1035353-1-kafai@fb.com
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions