#define END_VALUE NULL
struct ht_items_count {
- unsigned long add, remove;
+ unsigned long add, del;
} __attribute__((aligned(CAA_CACHE_LINE_SIZE)));
struct rcu_level {
}
static
-void ht_count_remove(struct cds_lfht *ht, unsigned long size)
+void ht_count_del(struct cds_lfht *ht, unsigned long size)
{
unsigned long percpu_count;
int cpu;
cpu = ht_get_cpu();
if (unlikely(cpu < 0))
return;
- percpu_count = uatomic_add_return(&ht->percpu_count[cpu].remove, -1);
+ percpu_count = uatomic_add_return(&ht->percpu_count[cpu].del, -1);
if (unlikely(!(percpu_count & ((1UL << COUNT_COMMIT_ORDER) - 1)))) {
unsigned long count;
- dbg_printf("remove percpu %lu\n", percpu_count);
+ dbg_printf("del percpu %lu\n", percpu_count);
count = uatomic_add_return(&ht->count,
-(1UL << COUNT_COMMIT_ORDER));
/* If power of 2 */
if (!(count & (count - 1))) {
if ((count >> CHAIN_LEN_RESIZE_THRESHOLD) >= size)
return;
- dbg_printf("remove set global %lu\n", count);
+ dbg_printf("del set global %lu\n", count);
cds_lfht_resize_lazy_count(ht, size,
count >> (CHAIN_LEN_TARGET - 1));
}
}
static
-void ht_count_remove(struct cds_lfht *ht, unsigned long size)
+void ht_count_del(struct cds_lfht *ht, unsigned long size)
{
}
}
static
-int _cds_lfht_remove(struct cds_lfht *ht, unsigned long size,
+int _cds_lfht_del(struct cds_lfht *ht, unsigned long size,
struct cds_lfht_node *node,
int dummy_removal)
{
i, j, !i ? 0 : (1UL << (i - 1)) + j);
fini_node->p.reverse_hash =
bit_reverse_ulong(!i ? 0 : (1UL << (i - 1)) + j);
- (void) _cds_lfht_remove(ht, !i ? 0 : (1UL << (i - 1)),
+ (void) _cds_lfht_del(ht, !i ? 0 : (1UL << (i - 1)),
fini_node, 1);
if (CMM_LOAD_SHARED(ht->in_progress_destroy))
break;
return ret;
}
-int cds_lfht_remove(struct cds_lfht *ht, struct cds_lfht_node *node)
+int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node)
{
unsigned long size;
int ret;
size = rcu_dereference(ht->t.size);
- ret = _cds_lfht_remove(ht, size, node, 0);
+ ret = _cds_lfht_del(ht, size, node, 0);
if (!ret)
- ht_count_remove(ht, size);
+ ht_count_del(ht, size);
return ret;
}
*
* Return NULL if no following node exists with same key.
* RCU read-side lock must be held across cds_lfht_lookup and cds_lfht_next calls, and also
- * between cds_lfht_next calls using the node returned by a previous cds_lfht_next.
- * Call with rcu_read_lock held.
+ * between cds_lfht_next calls using the node returned by a previous
+ * cds_lfht_next. Call with rcu_read_lock held.
*/
struct cds_lfht_node *cds_lfht_next(struct cds_lfht *ht, struct cds_lfht_node *node);
* cds_lfht_add_unique - add a node to hash table, if key is not present.
*
* Return the node added upon success.
- * Return the unique node already present upon failure. If cds_lfht_add_unique fails,
- * the node passed as parameter should be freed by the caller.
+ * Return the unique node already present upon failure. If
+ * cds_lfht_add_unique fails, the node passed as parameter should be
+ * freed by the caller.
* Call with rcu_read_lock held.
*/
struct cds_lfht_node *cds_lfht_add_unique(struct cds_lfht *ht, struct cds_lfht_node *node);
/*
- * cds_lfht_remove - remove node from hash table.
+ * cds_lfht_del - remove node from hash table.
*
- * Node can be looked up with cds_lfht_lookup. RCU read-side lock must be held between
- * lookup and removal.
+ * Node can be looked up with cds_lfht_lookup. RCU read-side lock must
+ * be held between lookup and removal.
* Call with rcu_read_lock held.
*/
-int cds_lfht_remove(struct cds_lfht *ht, struct cds_lfht_node *node);
+int cds_lfht_del(struct cds_lfht *ht, struct cds_lfht_node *node);
/*
* cds_lfht_resize - Force a hash table resize