[systemd-devel] [PATCH 04/11] tmpfiles: attach an array of items to each path
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Tue Jan 27 18:54:56 PST 2015
On Wed, Jan 28, 2015 at 02:59:24AM +0100, Lennart Poettering wrote:
> 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...
[I pushed the code a while ago.]
Yeah, that would work too, probably nicer than my array-based approach.
Fortunately this should be a narrow change to the code.
Zbyszek
More information about the systemd-devel
mailing list