diff options
author | Hengqi Chen <hengqi.chen@gmail.com> | 2021-10-03 00:10:00 +0800 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2021-10-06 12:34:02 -0700 |
commit | 4a404a7e8a3902fc560527241a611186605efb4e (patch) | |
tree | 0a71a79daf3e7f73f274e34798e8b40e824c927f /tools/lib/bpf/libbpf.h | |
parent | 9330303446382a33aa62a8a88a7a48555f76df0b (diff) | |
download | lwn-4a404a7e8a3902fc560527241a611186605efb4e.tar.gz lwn-4a404a7e8a3902fc560527241a611186605efb4e.zip |
libbpf: Deprecate bpf_object__unload() API since v0.6
BPF objects are not reloadable after unload. Users are expected to use
bpf_object__close() to unload and free up resources in one operation.
No need to expose bpf_object__unload() as a public API, deprecate it
([0]). Add bpf_object__unload() as an alias to internal
bpf_object_unload() and replace all bpf_object__unload() uses to avoid
compilation errors.
[0] Closes: https://github.com/libbpf/libbpf/issues/290
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Link: https://lore.kernel.org/bpf/20211002161000.3854559-1-hengqi.chen@gmail.com
Diffstat (limited to 'tools/lib/bpf/libbpf.h')
-rw-r--r-- | tools/lib/bpf/libbpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/lib/bpf/libbpf.h b/tools/lib/bpf/libbpf.h index e35490c54eb3..df10d14dbbb8 100644 --- a/tools/lib/bpf/libbpf.h +++ b/tools/lib/bpf/libbpf.h @@ -150,6 +150,7 @@ struct bpf_object_load_attr { /* Load/unload object into/from kernel */ LIBBPF_API int bpf_object__load(struct bpf_object *obj); LIBBPF_API int bpf_object__load_xattr(struct bpf_object_load_attr *attr); +LIBBPF_DEPRECATED_SINCE(0, 6, "bpf_object__unload() is deprecated, use bpf_object__close() instead") LIBBPF_API int bpf_object__unload(struct bpf_object *obj); LIBBPF_API const char *bpf_object__name(const struct bpf_object *obj); |