Skip to content

Commit fa98b54

Browse files
anakryikoAlexei Starovoitov
authored andcommitted
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 <[email protected]> Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent df7c3f7 commit fa98b54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5465,7 +5465,7 @@ bpf_object__create_maps(struct bpf_object *obj)
54655465
}
54665466
}
54675467

5468-
if (map->fd >= 0) {
5468+
if (map->reused) {
54695469
pr_debug("map '%s': skipping creation (preset fd=%d)\n",
54705470
map->name, map->fd);
54715471
} else {

0 commit comments

Comments
 (0)