diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2024-01-03 17:38:40 -0800 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2024-01-03 21:22:49 -0800 |
commit | fa98b54bff39f51c46fc96d3385c6292391c277b (patch) | |
tree | e044d275ee39e66f4c4724a3f92476a08326082f | |
parent | df7c3f7d3a3ddab31ca8cfa9b86a8729ec43fd2e (diff) | |
download | linux-stable-fa98b54bff39f51c46fc96d3385c6292391c277b.tar.gz linux-stable-fa98b54bff39f51c46fc96d3385c6292391c277b.tar.bz2 linux-stable-fa98b54bff39f51c46fc96d3385c6292391c277b.zip |
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>
-rw-r--r-- | tools/lib/bpf/libbpf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index f1521a400f02..3b678b617213 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -5465,7 +5465,7 @@ retry: } } - if (map->fd >= 0) { + if (map->reused) { pr_debug("map '%s': skipping creation (preset fd=%d)\n", map->name, map->fd); } else { |