Skip to content

Commit 0647169

Browse files
Andreas Gruenbacherdavem330
authored andcommitted
rhashtable: Documentation tweak
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>
1 parent 6073512 commit 0647169

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/rhashtable.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -735,9 +735,9 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_exit);
735735
* rhashtable_walk_start - Start a hash table walk
736736
* @iter: Hash table iterator
737737
*
738-
* Start a hash table walk. Note that we take the RCU lock in all
739-
* cases including when we return an error. So you must always call
740-
* rhashtable_walk_stop to clean up.
738+
* Start a hash table walk at the current iterator position. Note that we take
739+
* the RCU lock in all cases including when we return an error. So you must
740+
* always call rhashtable_walk_stop to clean up.
741741
*
742742
* Returns zero if successful.
743743
*
@@ -846,7 +846,8 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_next);
846846
* rhashtable_walk_stop - Finish a hash table walk
847847
* @iter: Hash table iterator
848848
*
849-
* Finish a hash table walk.
849+
* Finish a hash table walk. Does not reset the iterator to the start of the
850+
* hash table.
850851
*/
851852
void rhashtable_walk_stop(struct rhashtable_iter *iter)
852853
__releases(RCU)

0 commit comments

Comments
 (0)