提交 545a148e 编写于 作者: Y Ying Xue 提交者: David S. Miller

rhashtable: initialize atomic nelems variable

Signed-off-by: NYing Xue <ying.xue@windriver.com>
Cc: Thomas Graf <tgraf@suug.ch>
Acked-by: NThomas Graf <tgraf@suug.ch>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 c0c09bfd
...@@ -847,6 +847,7 @@ int rhashtable_init(struct rhashtable *ht, struct rhashtable_params *params) ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册