All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rhashtable: Documentation tweak
@ 2017-09-19 10:41 Andreas Gruenbacher
  2017-09-19 22:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Gruenbacher @ 2017-09-19 10:41 UTC (permalink / raw)
  To: Thomas Graf, Herbert Xu; +Cc: netdev, Andreas Gruenbacher

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>
---
 lib/rhashtable.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/rhashtable.c b/lib/rhashtable.c
index 707ca5d677c6..ddd7dde87c3c 100644
--- a/lib/rhashtable.c
+++ b/lib/rhashtable.c
@@ -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.
  *
@@ -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)
-- 
2.13.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rhashtable: Documentation tweak
  2017-09-19 10:41 [PATCH] rhashtable: Documentation tweak Andreas Gruenbacher
@ 2017-09-19 22:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-09-19 22:19 UTC (permalink / raw)
  To: agruenba; +Cc: tgraf, herbert, netdev

From: Andreas Gruenbacher <agruenba@redhat.com>
Date: Tue, 19 Sep 2017 12:41:37 +0200

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-19 22:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 10:41 [PATCH] rhashtable: Documentation tweak Andreas Gruenbacher
2017-09-19 22:19 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.