Skip to content

Commit 5300fdc

Browse files
tgrafdavem330
authored andcommitted
rhashtable: RCU annotations for next pointers
Properly annotate next pointers as access is RCU protected in the lookup path. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 0c9ab09 commit 5300fdc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/linux/rhashtable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include <linux/rculist.h>
2222

2323
struct rhash_head {
24-
struct rhash_head *next;
24+
struct rhash_head __rcu *next;
2525
};
2626

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

102102
bool rht_grow_above_75(const struct rhashtable *ht, size_t new_size);
103103
bool rht_shrink_below_30(const struct rhashtable *ht, size_t new_size);

lib/rhashtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ EXPORT_SYMBOL_GPL(rhashtable_insert);
386386
* deletion when combined with walking or lookup.
387387
*/
388388
void rhashtable_remove_pprev(struct rhashtable *ht, struct rhash_head *obj,
389-
struct rhash_head **pprev, gfp_t flags)
389+
struct rhash_head __rcu **pprev, gfp_t flags)
390390
{
391391
struct bucket_table *tbl = rht_dereference(ht->tbl, ht);
392392

0 commit comments

Comments
 (0)