summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2018-04-18 15:56:01 -0700
committerDaniel Borkmann <daniel@iogearbox.net>2018-04-19 21:46:25 +0200
commitf56a653c1fd13a197076dec4461c656fd2adec73 (patch)
treed6ccb94ff2fa8c17a385e4ca29ec6e4b446829a4 /include/linux
parentb00b8daec828dd59af7d1f7a42acd6e5867f80c6 (diff)
bpf: btf: Add BPF_BTF_LOAD command
This patch adds a BPF_BTF_LOAD command which 1) loads and verifies the BTF (implemented in earlier patches) 2) returns a BTF fd to userspace. In the next patch, the BTF fd can be specified during BPF_MAP_CREATE. It currently limits to CAP_SYS_ADMIN. Signed-off-by: Martin KaFai Lau <kafai@fb.com> Acked-by: Alexei Starovoitov <ast@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/btf.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/btf.h b/include/linux/btf.h
index d8bdab0280ba..a7c7072535ea 100644
--- a/include/linux/btf.h
+++ b/include/linux/btf.h
@@ -8,7 +8,11 @@
struct btf;
struct btf_type;
+union bpf_attr;
+void btf_put(struct btf *btf);
+int btf_new_fd(const union bpf_attr *attr);
+struct btf *btf_get_by_fd(int fd);
/* Figure out the size of a type_id. If type_id is a modifier
* (e.g. const), it will be resolved to find out the type with size.
*