Skip to content

Commit

Permalink
rhashtable: unexport and make rht_obj() static
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Graf authored and David S. Miller committed Aug 14, 2014
1 parent 5300fdc commit c91eee5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
1 change: 0 additions & 1 deletion include/linux/rhashtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ void rhashtable_destroy(const struct rhashtable *ht);
#define rht_dereference_rcu(p, ht) \
rcu_dereference_check(p, lockdep_rht_mutex_is_held(ht))

/* Internal, use rht_obj() instead */
#define rht_entry(ptr, type, member) container_of(ptr, type, member)
#define rht_entry_safe(ptr, type, member) \
({ \
Expand Down
8 changes: 1 addition & 7 deletions lib/rhashtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,10 @@ int lockdep_rht_mutex_is_held(const struct rhashtable *ht)
EXPORT_SYMBOL_GPL(lockdep_rht_mutex_is_held);
#endif

/**
* rht_obj - cast hash head to outer object
* @ht: hash table
* @he: hashed node
*/
void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he)
static void *rht_obj(const struct rhashtable *ht, const struct rhash_head *he)
{
return (void *) he - ht->p.head_offset;
}
EXPORT_SYMBOL_GPL(rht_obj);

static u32 __hashfn(const struct rhashtable *ht, const void *key,
u32 len, u32 hsize)
Expand Down

0 comments on commit c91eee5

Please sign in to comment.