diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2021-11-03 23:08:37 +0100 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2021-11-07 17:34:23 +0100 |
commit | e32660ac6fd6bd3c9d249644330d968c6ef61b07 (patch) | |
tree | 09b3b0da3d2d7271eb24ae98c27c376b878bc4dc /tools/lib/bpf/bpf.c | |
parent | libbpf: Unify low-level BPF_PROG_LOAD APIs into bpf_prog_load() (diff) | |
download | linux-e32660ac6fd6bd3c9d249644330d968c6ef61b07.tar.xz linux-e32660ac6fd6bd3c9d249644330d968c6ef61b07.zip |
libbpf: Remove internal use of deprecated bpf_prog_load() variants
Remove all the internal uses of bpf_load_program_xattr(), which is
slated for deprecation in v0.7.
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20211103220845.2676888-5-andrii@kernel.org
Diffstat (limited to 'tools/lib/bpf/bpf.c')
-rw-r--r-- | tools/lib/bpf/bpf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/lib/bpf/bpf.c b/tools/lib/bpf/bpf.c index 8f2a701cb079..4ff45749f8cf 100644 --- a/tools/lib/bpf/bpf.c +++ b/tools/lib/bpf/bpf.c @@ -401,8 +401,12 @@ done: return libbpf_err_errno(fd); } +__attribute__((alias("bpf_load_program_xattr2"))) int bpf_load_program_xattr(const struct bpf_load_program_attr *load_attr, - char *log_buf, size_t log_buf_sz) + char *log_buf, size_t log_buf_sz); + +static int bpf_load_program_xattr2(const struct bpf_load_program_attr *load_attr, + char *log_buf, size_t log_buf_sz) { LIBBPF_OPTS(bpf_prog_load_opts, p); @@ -456,7 +460,7 @@ int bpf_load_program(enum bpf_prog_type type, const struct bpf_insn *insns, load_attr.license = license; load_attr.kern_version = kern_version; - return bpf_load_program_xattr(&load_attr, log_buf, log_buf_sz); + return bpf_load_program_xattr2(&load_attr, log_buf, log_buf_sz); } int bpf_verify_program(enum bpf_prog_type type, const struct bpf_insn *insns, |