Commit 545a148e authored by Ying Xue's avatar Ying Xue Committed by David S. Miller
Browse files

rhashtable: initialize atomic nelems variable

Signed-off-by: default avatarYing Xue <>
Cc: Thomas Graf <>
Acked-by: default avatarThomas Graf <>
Signed-off-by: default avatarDavid S. Miller <>
parent c0c09bfd
......@@ -847,6 +847,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
if (tbl == NULL)
return -ENOMEM;
atomic_set(&ht->nelems, 0);
atomic_set(&ht->shift, ilog2(tbl->size));
RCU_INIT_POINTER(ht->tbl, tbl);
RCU_INIT_POINTER(ht->future_tbl, tbl);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment