mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 13:53:33 +00:00
rhashtable: initialize atomic nelems variable
Signed-off-by: Ying Xue <ying.xue@windriver.com> Cc: Thomas Graf <tgraf@suug.ch> Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c0c09bfdc4
commit
545a148e43
1 changed files with 1 additions and 0 deletions
|
@ -847,6 +847,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params)
|
||||||
if (tbl == NULL)
|
if (tbl == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
atomic_set(&ht->nelems, 0);
|
||||||
atomic_set(&ht->shift, ilog2(tbl->size));
|
atomic_set(&ht->shift, ilog2(tbl->size));
|
||||||
RCU_INIT_POINTER(ht->tbl, tbl);
|
RCU_INIT_POINTER(ht->tbl, tbl);
|
||||||
RCU_INIT_POINTER(ht->future_tbl, tbl);
|
RCU_INIT_POINTER(ht->future_tbl, tbl);
|
||||||
|
|
Loading…
Reference in a new issue