rculfhash: API rename: remove -> del
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 20 Sep 2011 23:34:49 +0000 (19:34 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 20 Sep 2011 23:34:49 +0000 (19:34 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
rculfhash.c
tests/test_urcu_hash.c
urcu/rculfhash.h

index b11bbf41c5308e4505fbea492bae09cb5d622b74..074a6f4ea8c4c40f7b2f7374d3ecdc8387e34bff 100644 (file)
 #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 {
@@ -565,7 +565,7 @@ void ht_count_add(struct cds_lfht *ht, unsigned long size)
 }
 
 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;
@@ -575,18 +575,18 @@ void ht_count_remove(struct cds_lfht *ht, unsigned long size)
        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));
                }
@@ -614,7 +614,7 @@ void ht_count_add(struct cds_lfht *ht, unsigned long size)
 }
 
 static
-void ht_count_remove(struct cds_lfht *ht, unsigned long size)
+void ht_count_del(struct cds_lfht *ht, unsigned long size)
 {
 }
 
@@ -844,7 +844,7 @@ gc_end:
 }
 
 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)
 {
@@ -1077,7 +1077,7 @@ void remove_table_partition(struct cds_lfht *ht, unsigned long i,
                           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;
@@ -1299,15 +1299,15 @@ struct cds_lfht_node *cds_lfht_add_unique(struct cds_lfht *ht,
        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;
 }
 
index 238b8e560e0cc12caeb88d307723e3b90650813d..c19a4876df4443add7031311ccf161504abb08f6 100644 (file)
@@ -484,7 +484,7 @@ void *thr_writer(void *_count)
                                (void *)(((unsigned long) rand_r(&rand_lookup) % write_pool_size) + write_pool_offset),
                                sizeof(void *));
                        if (node)
-                               ret = cds_lfht_remove(test_ht, node);
+                               ret = cds_lfht_del(test_ht, node);
                        else
                                ret = -ENOENT;
                        rcu_read_unlock();
index 4f7cc526f9ddc93528276c3e5740dab9c6f54f9f..c1c9ddcf2a28d662668bf0ac465e658417730828 100644 (file)
@@ -171,8 +171,8 @@ struct cds_lfht_node *cds_lfht_lookup(struct cds_lfht *ht, void *key, size_t key
  *
  * 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);
 
@@ -187,20 +187,21 @@ void cds_lfht_add(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
This page took 0.029192 seconds and 4 git commands to generate.