[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 10/12] qht: constify qht_statistics_init
From: |
Emilio G. Cota |
Subject: |
[Qemu-devel] [PATCH v2 10/12] qht: constify qht_statistics_init |
Date: |
Mon, 10 Sep 2018 14:58:57 -0400 |
Signed-off-by: Emilio G. Cota <address@hidden>
---
include/qemu/qht.h | 2 +-
util/qht.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/qemu/qht.h b/include/qemu/qht.h
index 2e2d6bca93..758c7ac6c8 100644
--- a/include/qemu/qht.h
+++ b/include/qemu/qht.h
@@ -211,7 +211,7 @@ void qht_iter_remove(struct qht *ht, qht_iter_bool_func_t
func, void *userp);
* When done with @stats, pass the struct to qht_statistics_destroy().
* Failing to do this will leak memory.
*/
-void qht_statistics_init(struct qht *ht, struct qht_stats *stats);
+void qht_statistics_init(const struct qht *ht, struct qht_stats *stats);
/**
* qht_statistics_destroy - Destroy a &struct qht_stats
diff --git a/util/qht.c b/util/qht.c
index 020dfe6912..4378775d68 100644
--- a/util/qht.c
+++ b/util/qht.c
@@ -895,9 +895,9 @@ bool qht_resize(struct qht *ht, size_t n_elems)
}
/* pass @stats to qht_statistics_destroy() when done */
-void qht_statistics_init(struct qht *ht, struct qht_stats *stats)
+void qht_statistics_init(const struct qht *ht, struct qht_stats *stats)
{
- struct qht_map *map;
+ const struct qht_map *map;
int i;
map = atomic_rcu_read(&ht->map);
@@ -914,8 +914,8 @@ void qht_statistics_init(struct qht *ht, struct qht_stats
*stats)
stats->head_buckets = map->n_buckets;
for (i = 0; i < map->n_buckets; i++) {
- struct qht_bucket *head = &map->buckets[i];
- struct qht_bucket *b;
+ const struct qht_bucket *head = &map->buckets[i];
+ const struct qht_bucket *b;
unsigned int version;
size_t buckets;
size_t entries;
--
2.17.1
- [Qemu-devel] [PATCH v2 00/12] qht improvements for 3.1, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 02/12] qht: add qht_iter_remove, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 01/12] qht: remove unused map param from qht_remove__locked, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 08/12] qht: fix comment in qht_bucket_remove_entry, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 10/12] qht: constify qht_statistics_init,
Emilio G. Cota <=
- [Qemu-devel] [PATCH v2 04/12] test-qht: test removal of non-existent entries, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 11/12] qht: constify arguments to some internal functions, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 03/12] test-qht: test qht_iter_remove, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 09/12] qht: constify qht_lookup, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 05/12] test-qht: test deletion of the last entry in a bucket, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 06/12] test-qht: speed up + test qht_resize, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 07/12] qht: drop ht argument from qht iterators, Emilio G. Cota, 2018/09/10
- [Qemu-devel] [PATCH v2 12/12] qht-bench: add -p flag to precompute hash values, Emilio G. Cota, 2018/09/10