summaryrefslogtreecommitdiffstats
path: root/src/portable
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-11-28 14:54:44 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-12-02 12:18:54 +0100
commitb07ec5a173f285c35661150764562fb78bb6fadd (patch)
tree28fe94c8ff17b893ea5ddd7b0addb4e9b82ae471 /src/portable
parenttmpfiles: define main through macro (diff)
downloadsystemd-b07ec5a173f285c35661150764562fb78bb6fadd.tar.xz
systemd-b07ec5a173f285c35661150764562fb78bb6fadd.zip
machine-image: introduce image_hash_ops and use it
Diffstat (limited to 'src/portable')
-rw-r--r--src/portable/portabled-bus.c4
-rw-r--r--src/portable/portabled-image-bus.c4
-rw-r--r--src/portable/portabled-image.c4
-rw-r--r--src/portable/portabled.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/src/portable/portabled-bus.c b/src/portable/portabled-bus.c
index 70fc750fe3..ec93838538 100644
--- a/src/portable/portabled-bus.c
+++ b/src/portable/portabled-bus.c
@@ -131,7 +131,7 @@ static int method_get_image(sd_bus_message *message, void *userdata, sd_bus_erro
static int method_list_images(sd_bus_message *message, void *userdata, sd_bus_error *error) {
_cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL;
- _cleanup_(image_hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
Manager *m = userdata;
Image *image;
Iterator i;
@@ -140,7 +140,7 @@ static int method_list_images(sd_bus_message *message, void *userdata, sd_bus_er
assert(message);
assert(m);
- images = hashmap_new(&string_hash_ops);
+ images = hashmap_new(&image_hash_ops);
if (!images)
return -ENOMEM;
diff --git a/src/portable/portabled-image-bus.c b/src/portable/portabled-image-bus.c
index 0e1f7c5e87..ec39205dc4 100644
--- a/src/portable/portabled-image-bus.c
+++ b/src/portable/portabled-image-bus.c
@@ -693,7 +693,7 @@ not_found:
}
int bus_image_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error) {
- _cleanup_(image_hashmap_freep) Hashmap *images = NULL;
+ _cleanup_hashmap_free_ Hashmap *images = NULL;
_cleanup_strv_free_ char **l = NULL;
size_t n_allocated = 0, n = 0;
Manager *m = userdata;
@@ -705,7 +705,7 @@ int bus_image_node_enumerator(sd_bus *bus, const char *path, void *userdata, cha
assert(path);
assert(nodes);
- images = hashmap_new(&string_hash_ops);
+ images = hashmap_new(&image_hash_ops);
if (!images)
return -ENOMEM;
diff --git a/src/portable/portabled-image.c b/src/portable/portabled-image.c
index a6b3f52e99..d95845b32a 100644
--- a/src/portable/portabled-image.c
+++ b/src/portable/portabled-image.c
@@ -16,7 +16,7 @@ static int image_cache_flush(sd_event_source *s, void *userdata) {
assert(s);
assert(m);
- hashmap_clear_with_destructor(m->image_cache, image_unref);
+ hashmap_clear(m->image_cache);
return 0;
}
@@ -25,7 +25,7 @@ static int manager_image_cache_initialize(Manager *m) {
assert(m);
- r = hashmap_ensure_allocated(&m->image_cache, &string_hash_ops);
+ r = hashmap_ensure_allocated(&m->image_cache, &image_hash_ops);
if (r < 0)
return r;
diff --git a/src/portable/portabled.c b/src/portable/portabled.c
index cfaf2a59e3..63fc340469 100644
--- a/src/portable/portabled.c
+++ b/src/portable/portabled.c
@@ -47,7 +47,7 @@ static int manager_new(Manager **ret) {
static Manager* manager_unref(Manager *m) {
assert(m);
- hashmap_free_with_destructor(m->image_cache, image_unref);
+ hashmap_free(m->image_cache);
sd_event_source_unref(m->image_cache_defer_event);