[systemd-devel] [PATCH 04/11] tmpfiles: attach an array of items to each path

Lennart Poettering lennart at poettering.net
Tue Jan 27 17:59:24 PST 2015

On Mon, 19.01.15 01:20, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:

> The data structure used by tmpfiles is changed: instead of hashmaps
> mapping {path → Item*} we now have hashmaps containing
> {path -> ItemArray}, where ItemArray contains a pointer
> to an array of Items.

I figure one of those days we really should add a proper MultiHashmap
type or so, that can map one key to multiple values. There are quite a
few cases we could have used this so far, and this is the next one.

So far we usually resorted to using a hashmap that points to a linked
list of items, using the LIST_FIELDS macros for the list. That has the
nice effect that ignoring the list makes the this multi-map behave
exactly like a normal map, i.e. it points to one valid object...


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list