Skip to content

Commit c91eee5

Browse files
tgrafdavem330
authored andcommitted
rhashtable: unexport and make rht_obj() static
No need to export rht_obj(), all inner to outer object translations occur internally. It was intended to be used with rht_for_each() which now primarily serves as the iterator for rhashtable_remove_pprev() to effectively flush and free the full table. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5300fdc commit c91eee5

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

include/linux/rhashtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ void rhashtable_destroy(const struct rhashtable *ht);
117117
#define rht_dereference_rcu(p, ht) \
118118
rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht))
119119

120-
/* Internal, use rht_obj() instead */
121120
#define rht_entry(ptr, type, member) container_of(ptr, type, member)
122121
#define rht_entry_safe(ptr, type, member) \
123122
({ \

lib/rhashtable.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,10 @@ int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
3838
EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held);
3939
#endif
4040

41-
/**
42-
* rht_obj - cast hash head to outer object
43-
* @ht: hash table
44-
* @he: hashed node
45-
*/
46-
void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he)
41+
static void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he)
4742
{
4843
return (void *) he - ht->p.head_offset;
4944
}
50-
EXPORT_SYMBOL_GPL(rht_obj);
5145

5246
static u32 __hashfn(const struct rhashtable *ht, const void *key,
5347
u32 len, u32 hsize)

0 commit comments

Comments
 (0)