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

Greg KH greg at kroah.com
Sun Jan 18 18:00:22 PST 2015


On Mon, Jan 19, 2015 at 01:20:37AM +0100, Zbigniew Jędrzejewski-Szmek 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.
> 
> For current code it doesn't matter much, but when we add new types it
> is easier to simply add a new Item for a given path, then to coalesce
> multiple lines into one Item.
> 
> In the future, this change will also make it possible to remember the
> file and line where each Item originates, and use that in reporting
> errors. Currently this is not possible, since each Item can be created
> from multiple lines.
> ---
>  man/tmpfiles.d.xml      |  13 +-
>  src/tmpfiles/tmpfiles.c | 308 ++++++++++++++++++++++++------------------------
>  2 files changed, 160 insertions(+), 161 deletions(-)

Oh, I like this, nice job.  As someone who has tried to add new
functionalty to this code, this looks to make it much easier to do in
the future, if it is needed.

Bonus being it's the same number of lines :)

good work,

greg k-h


More information about the systemd-devel mailing list