Skip to content

Commit

Permalink
rhashtable: RCU annotations for next pointers
Browse files Browse the repository at this point in the history
Properly annotate next pointers as access is RCU protected in
the lookup path.

Signed-off-by: Thomas Graf <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tgraf authored and davem330 committed Aug 14, 2014
1 parent 0c9ab09 commit 5300fdc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions include/linux/rhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <linux/rculist.h>

struct rhash_head {
struct rhash_head *next;
struct rhash_head __rcu *next;
};

#define INIT_HASH_HEAD(ptr) ((ptr)->next = NULL)
Expand Down Expand Up @@ -97,7 +97,7 @@ u32 rhashtable_obj_hashfn(const struct rhashtable *ht, void *ptr);
void rhashtable_insert(struct rhashtable *ht, struct rhash_head *node, gfp_t);
bool rhashtable_remove(struct rhashtable *ht, struct rhash_head *node, gfp_t);
void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
struct rhash_head **pprev, gfp_t flags);
struct rhash_head __rcu **pprev, gfp_t flags);

bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size);
bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size);
Expand Down
2 changes: 1 addition & 1 deletion lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ EXPORT_SYMBOL_GPL(rhashtable_insert);
* deletion when combined with walking or lookup.
*/
void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
struct rhash_head **pprev, gfp_t flags)
struct rhash_head __rcu **pprev, gfp_t flags)
{
struct bucket_table *tbl = rht_dereference(ht->tbl, ht);

Expand Down

0 comments on commit 5300fdc

Please sign in to comment.