Fix: removed useless key from relay_index
authorJulien Desfossez <jdesfossez@efficios.com>
Tue, 11 Nov 2014 20:57:47 +0000 (15:57 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 16 Nov 2014 14:57:46 +0000 (09:57 -0500)
This field was never used except in debug messages (instead of using the
good value that is part of index_n).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/index.c
src/bin/lttng-relayd/index.h

index 8cacdd2f01eb8807d9a5d5de239277b311776256..5d09667cf8226575c9e98f606215aeea4ca2180e 100644 (file)
@@ -116,7 +116,7 @@ void relay_index_add(struct relay_index *index, struct relay_index **_index)
        assert(index);
 
        DBG2("Adding relay index with stream id %" PRIu64 " and seqnum %" PRIu64,
-                       index->key.key1, index->key.key2);
+                       index->index_n.key.key1, index->index_n.key.key2);
 
        node_ptr = cds_lfht_add_unique(indexes_ht->ht,
                        indexes_ht->hash_fct((void *) &index->index_n.key, lttng_ht_seed),
@@ -141,7 +141,8 @@ int relay_index_write(int fd, struct relay_index *index)
        struct lttng_ht_iter iter;
 
        DBG2("Writing index for stream ID %" PRIu64 " and seq num %" PRIu64
-                       " on fd %d", index->key.key1, index->key.key2, fd);
+                       " on fd %d", index->index_n.key.key1,
+                       index->index_n.key.key2, fd);
 
        /* Delete index from hash table. */
        iter.iter.node = &index->index_n.node;
@@ -183,7 +184,8 @@ void relay_index_delete(struct relay_index *index)
        struct lttng_ht_iter iter;
 
        DBG3("Relay index with stream ID %" PRIu64 " and seq num %" PRIu64
-                       "deleted.", index->key.key1, index->key.key2);
+                       " deleted.", index->index_n.key.key1,
+                       index->index_n.key.key2);
 
        /* Delete index from hash table. */
        iter.iter.node = &index->index_n.node;
@@ -201,7 +203,7 @@ void relay_index_destroy_by_stream_id(uint64_t stream_id)
 
        rcu_read_lock();
        cds_lfht_for_each_entry(indexes_ht->ht, &iter.iter, index, index_n.node) {
-               if (index->key.key1 == stream_id) {
+               if (index->index_n.key.key1 == stream_id) {
                        relay_index_delete(index);
                        relay_index_free_safe(index);
                }
index 9a10cea446e7529553a94588c296c0d867e12e28..e7f9cdbd07d98ebafacc1dfb122fb525e18778f3 100644 (file)
@@ -39,7 +39,6 @@ struct relay_index {
        struct ctf_packet_index index_data;
 
        /* key1 = stream_id, key2 = net_seq_num */
-       struct lttng_ht_two_u64 key;
        struct lttng_ht_node_two_u64 index_n;
        struct rcu_head rcu_node;
        pthread_mutex_t mutex;
This page took 0.026902 seconds and 4 git commands to generate.