Skip to content

Commit

Permalink
rhashtable: Documentation tweak
Browse files Browse the repository at this point in the history
Clarify that rhashtable_walk_{stop,start} will not reset the iterator to
the beginning of the hash table.  Confusion between rhashtable_walk_enter
and rhashtable_walk_start has already lead to a bug.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Andreas Gruenbacher authored and David S. Miller committed Sep 19, 2017
1 parent 6073512 commit 0647169
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,9 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_exit);
* rhashtable_walk_start - Start a hash table walk
* @iter: Hash table iterator
*
* Start a hash table walk. Note that we take the RCU lock in all
* cases including when we return an error. So you must always call
* rhashtable_walk_stop to clean up.
* Start a hash table walk at the current iterator position. Note that we take
* the RCU lock in all cases including when we return an error. So you must
* always call rhashtable_walk_stop to clean up.
*
* Returns zero if successful.
*
Expand Down Expand Up @@ -846,7 +846,8 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_next);
* rhashtable_walk_stop - Finish a hash table walk
* @iter: Hash table iterator
*
* Finish a hash table walk.
* Finish a hash table walk. Does not reset the iterator to the start of the
* hash table.
*/
void rhashtable_walk_stop(struct rhashtable_iter *iter)
__releases(RCU)
Expand Down

0 comments on commit 0647169

Please sign in to comment.