diff options
author | Toke Høiland-Jørgensen <toke@redhat.com> | 2019-11-02 12:09:38 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-11-02 12:35:07 -0700 |
commit | 4580b25fcee5347327aaffcec31c615ec28a889a (patch) | |
tree | 71cf7bd577f474ac8f27980028e991c0440161dd /tools/lib/bpf/libbpf.map | |
parent | d1b4574a4b86565325ef2e545eda8dfc9aa07c60 (diff) | |
download | lwn-4580b25fcee5347327aaffcec31c615ec28a889a.tar.gz lwn-4580b25fcee5347327aaffcec31c615ec28a889a.zip |
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
Diffstat (limited to 'tools/lib/bpf/libbpf.map')
-rw-r--r-- | tools/lib/bpf/libbpf.map | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.map b/tools/lib/bpf/libbpf.map index 69dded5af00b..86173cbb159d 100644 --- a/tools/lib/bpf/libbpf.map +++ b/tools/lib/bpf/libbpf.map @@ -193,6 +193,9 @@ LIBBPF_0.0.5 { LIBBPF_0.0.6 { global: + bpf_map__get_pin_path; + bpf_map__is_pinned; + bpf_map__set_pin_path; bpf_object__open_file; bpf_object__open_mem; bpf_program__get_expected_attach_type; |