libbpf: use explicit map reuse flag to skip map creation steps
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 4 Jan 2024 01:38:40 +0000 (17:38 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 4 Jan 2024 05:22:49 +0000 (21:22 -0800)
commitfa98b54bff39f51c46fc96d3385c6292391c277b
treee044d275ee39e66f4c4724a3f92476a08326082f
parentdf7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e
libbpf: use explicit map reuse flag to skip map creation steps

Instead of inferring whether map already point to previously
created/pinned BPF map (which user can specify with bpf_map__reuse_fd()) API),
use explicit map->reused flag that is set in such case.

Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240104013847.3875810-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/lib/bpf/libbpf.c