mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-09 10:09:07 +08:00
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>
This commit is contained in:
committed by
Andrii Nakryiko
parent
3fb45d3761
commit
e9ce55197b
@@ -5465,7 +5465,7 @@ retry:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (map->fd >= 0) {
|
if (map->reused) {
|
||||||
pr_debug("map '%s': skipping creation (preset fd=%d)\n",
|
pr_debug("map '%s': skipping creation (preset fd=%d)\n",
|
||||||
map->name, map->fd);
|
map->name, map->fd);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user