]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Store map pin path and status in struct bpf_map
authorToke Høiland-Jørgensen <toke@redhat.com>
Sat, 2 Nov 2019 11:09:38 +0000 (12:09 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Sat, 2 Nov 2019 19:35:07 +0000 (12:35 -0700)
commitaf3e2c5ea7dad62672e4cf699f0d46b5a24cc565
tree71cf7bd577f474ac8f27980028e991c0440161dd
parent315e9f9aeeec48c4869a2dde096dbf507f6662a7
libbpf: Store map pin path and status in struct bpf_map

Support storing and setting a pin path in struct bpf_map, which can be used
for automatic pinning. Also store the pin status so we can avoid attempts
to re-pin a map that has already been pinned (or reused from a previous
pinning).

The behaviour of bpf_object__{un,}pin_maps() is changed so that if it is
called with a NULL path argument (which was previously illegal), it will
(un)pin only those maps that have a pin_path set.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/157269297876.394725.14782206533681896279.stgit@toke.dk
tools/lib/bpf/libbpf.c
tools/lib/bpf/libbpf.h
tools/lib/bpf/libbpf.map