diff options
author | Roman Gushchin <guro@fb.com> | 2018-08-02 17:27:18 -0400 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2018-08-02 18:47:32 -0400 |
commit | de9cbbaadba5adf88a19e46df61f7054000838f6 (patch) | |
tree | 6cfafffa94b145c7d4e0e986a75178262c843385 /include/linux/bpf.h | |
parent | 0a4c58f5702858822621fa1177c7d3475f181ccb (diff) |
bpf: introduce cgroup storage maps
This commit introduces BPF_MAP_TYPE_CGROUP_STORAGE maps:
a special type of maps which are implementing the cgroup storage.
>From the userspace point of view it's almost a generic
hash map with the (cgroup inode id, attachment type) pair
used as a key.
The only difference is that some operations are restricted:
1) a user can't create new entries,
2) a user can't remove existing entries.
The lookup from userspace is o(log(n)).
Signed-off-by: Roman Gushchin <guro@fb.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/bpf.h')
-rw-r--r-- | include/linux/bpf.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 5a4a256473c3..9d1e4727495e 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h | |||
@@ -282,6 +282,7 @@ struct bpf_prog_aux { | |||
282 | struct bpf_prog *prog; | 282 | struct bpf_prog *prog; |
283 | struct user_struct *user; | 283 | struct user_struct *user; |
284 | u64 load_time; /* ns since boottime */ | 284 | u64 load_time; /* ns since boottime */ |
285 | struct bpf_map *cgroup_storage; | ||
285 | char name[BPF_OBJ_NAME_LEN]; | 286 | char name[BPF_OBJ_NAME_LEN]; |
286 | #ifdef CONFIG_SECURITY | 287 | #ifdef CONFIG_SECURITY |
287 | void *security; | 288 | void *security; |