Commit bcc40fc0 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Alexei Starovoitov

libbpf: Stop using to-be-deprecated APIs

Remove all the internal uses of libbpf APIs that are slated to be
deprecated in v0.7.
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211103220845.2676888-6-andrii@kernel.org
parent e32660ac
...@@ -7709,7 +7709,7 @@ int bpf_object__pin_maps(struct bpf_object *obj, const char *path) ...@@ -7709,7 +7709,7 @@ int bpf_object__pin_maps(struct bpf_object *obj, const char *path)
return 0; return 0;
err_unpin_maps: err_unpin_maps:
while ((map = bpf_map__prev(map, obj))) { while ((map = bpf_object__prev_map(obj, map))) {
if (!map->pin_path) if (!map->pin_path)
continue; continue;
...@@ -7789,7 +7789,7 @@ int bpf_object__pin_programs(struct bpf_object *obj, const char *path) ...@@ -7789,7 +7789,7 @@ int bpf_object__pin_programs(struct bpf_object *obj, const char *path)
return 0; return 0;
err_unpin_programs: err_unpin_programs:
while ((prog = bpf_program__prev(prog, obj))) { while ((prog = bpf_object__prev_program(obj, prog))) {
char buf[PATH_MAX]; char buf[PATH_MAX];
int len; int len;
...@@ -8130,9 +8130,11 @@ int bpf_program__set_autoload(struct bpf_program *prog, bool autoload) ...@@ -8130,9 +8130,11 @@ int bpf_program__set_autoload(struct bpf_program *prog, bool autoload)
return 0; return 0;
} }
static int bpf_program_nth_fd(const struct bpf_program *prog, int n);
int bpf_program__fd(const struct bpf_program *prog) int bpf_program__fd(const struct bpf_program *prog)
{ {
return bpf_program__nth_fd(prog, 0); return bpf_program_nth_fd(prog, 0);
} }
size_t bpf_program__size(const struct bpf_program *prog) size_t bpf_program__size(const struct bpf_program *prog)
...@@ -8178,7 +8180,10 @@ int bpf_program__set_prep(struct bpf_program *prog, int nr_instances, ...@@ -8178,7 +8180,10 @@ int bpf_program__set_prep(struct bpf_program *prog, int nr_instances,
return 0; return 0;
} }
int bpf_program__nth_fd(const struct bpf_program *prog, int n) __attribute__((alias("bpf_program_nth_fd")))
int bpf_program__nth_fd(const struct bpf_program *prog, int n);
static int bpf_program_nth_fd(const struct bpf_program *prog, int n)
{ {
int fd; int fd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment