]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit - lib/rhashtable.c
rhashtable: Add rhastable_walk_peek
authorTom Herbert <tom@quantonium.net>
Mon, 4 Dec 2017 18:31:42 +0000 (10:31 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Dec 2017 14:58:38 +0000 (09:58 -0500)
commit2db54b475ae918d274bfc276416c384ba95e9f94
treec5e93acd923da0ed13d64dad38fc9d10ff25a229
parent97a6ec4ac021f7fbec05c15a3aa0c4aaf0461af5
rhashtable: Add rhastable_walk_peek

This function is like rhashtable_walk_next except that it only returns
the current element in the inter and does not advance the iter.

This patch also creates __rhashtable_walk_find_next. It finds the next
element in the table when the entry cached in iter is NULL or at the end
of a slot. __rhashtable_walk_find_next is called from
rhashtable_walk_next and rhastable_walk_peek.

end_of_table is an added field to the iter structure. This indicates
that the end of table was reached (walker.tbl being NULL is not a
sufficient condition for end of table).

Signed-off-by: Tom Herbert <tom@quantonium.net>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/rhashtable.h
lib/rhashtable.c