libbpf: refactor map initialization
authorAndrii Nakryiko <andriin@fb.com>
Mon, 17 Jun 2019 19:26:53 +0000 (12:26 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 17 Jun 2019 22:10:39 +0000 (00:10 +0200)
commitbf82927125dd25003d76ed5541da704df21de57a
tree991f621f7ec18f306ed65911d89212b007c8cbf0
parent01b29d1dc9a06e2cdc6a0172d35605eb0300ecb2
libbpf: refactor map initialization

User and global data maps initialization has gotten pretty complicated
and unnecessarily convoluted. This patch splits out the logic for global
data map and user-defined map initialization. It also removes the
restriction of pre-calculating how many maps will be initialized,
instead allowing to keep adding new maps as they are discovered, which
will be used later for BTF-defined map definitions.

Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c