rhashtable: Annotate RCU locking of walkers
authorThomas Graf <tgraf@suug.ch>
Mon, 16 Mar 2015 09:42:27 +0000 (10:42 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Mar 2015 20:24:13 +0000 (16:24 -0400)
Fixes the following sparse warnings:

lib/rhashtable.c:767:5: warning: context imbalance in 'rhashtable_walk_start' - wrong count at exit
lib/rhashtable.c:849:6: warning: context imbalance in 'rhashtable_walk_stop' - unexpected unlock

Fixes: f2dba9c6ff0d ("rhashtable: Introduce rhashtable_walk_*")
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/rhashtable.c

index c523d3a563aa8858acfba422305d07898ebc5a9f..eae26a67bd1842140488ceff6da0cdf7197fe9a9 100644 (file)
@@ -760,6 +760,7 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_exit);
  * by calling rhashtable_walk_next.
  */
 int rhashtable_walk_start(struct rhashtable_iter *iter)
+       __acquires(RCU)
 {
        struct rhashtable *ht = iter->ht;
 
@@ -847,6 +848,7 @@ EXPORT_SYMBOL_GPL(rhashtable_walk_next);
  * Finish a hash table walk.
  */
 void rhashtable_walk_stop(struct rhashtable_iter *iter)
+       __releases(RCU)
 {
        struct rhashtable *ht;
        struct bucket_table *tbl = iter->walker->tbl;