mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-05 22:28:00 +00:00
ebpf: move CONFIG_BPF_SYSCALL-only function declarations
Masami noted that it would be better to hide the remaining CONFIG_BPF_SYSCALL-only function declarations within the BPF header ifdef, w/o else path dummy alternatives since these functions are not supposed to have a user outside of CONFIG_BPF_SYSCALL. Suggested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Reference: http://article.gmane.org/gmane.linux.kernel.api/8658 Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
77f0379fa8
commit
61e021f3b8
1 changed files with 9 additions and 9 deletions
|
@ -42,10 +42,6 @@ struct bpf_map_type_list {
|
||||||
enum bpf_map_type type;
|
enum bpf_map_type type;
|
||||||
};
|
};
|
||||||
|
|
||||||
void bpf_register_map_type(struct bpf_map_type_list *tl);
|
|
||||||
void bpf_map_put(struct bpf_map *map);
|
|
||||||
struct bpf_map *bpf_map_get(struct fd f);
|
|
||||||
|
|
||||||
/* function argument constraints */
|
/* function argument constraints */
|
||||||
enum bpf_arg_type {
|
enum bpf_arg_type {
|
||||||
ARG_ANYTHING = 0, /* any argument is ok */
|
ARG_ANYTHING = 0, /* any argument is ok */
|
||||||
|
@ -126,9 +122,16 @@ struct bpf_prog_aux {
|
||||||
|
|
||||||
#ifdef CONFIG_BPF_SYSCALL
|
#ifdef CONFIG_BPF_SYSCALL
|
||||||
void bpf_register_prog_type(struct bpf_prog_type_list *tl);
|
void bpf_register_prog_type(struct bpf_prog_type_list *tl);
|
||||||
|
void bpf_register_map_type(struct bpf_map_type_list *tl);
|
||||||
|
|
||||||
void bpf_prog_put(struct bpf_prog *prog);
|
|
||||||
struct bpf_prog *bpf_prog_get(u32 ufd);
|
struct bpf_prog *bpf_prog_get(u32 ufd);
|
||||||
|
void bpf_prog_put(struct bpf_prog *prog);
|
||||||
|
|
||||||
|
struct bpf_map *bpf_map_get(struct fd f);
|
||||||
|
void bpf_map_put(struct bpf_map *map);
|
||||||
|
|
||||||
|
/* verify correctness of eBPF program */
|
||||||
|
int bpf_check(struct bpf_prog *fp, union bpf_attr *attr);
|
||||||
#else
|
#else
|
||||||
static inline void bpf_register_prog_type(struct bpf_prog_type_list *tl)
|
static inline void bpf_register_prog_type(struct bpf_prog_type_list *tl)
|
||||||
{
|
{
|
||||||
|
@ -142,10 +145,7 @@ static inline struct bpf_prog *bpf_prog_get(u32 ufd)
|
||||||
static inline void bpf_prog_put(struct bpf_prog *prog)
|
static inline void bpf_prog_put(struct bpf_prog *prog)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endif
|
#endif /* CONFIG_BPF_SYSCALL */
|
||||||
|
|
||||||
/* verify correctness of eBPF program */
|
|
||||||
int bpf_check(struct bpf_prog *fp, union bpf_attr *attr);
|
|
||||||
|
|
||||||
/* verifier prototypes for helper functions called from eBPF programs */
|
/* verifier prototypes for helper functions called from eBPF programs */
|
||||||
extern const struct bpf_func_proto bpf_map_lookup_elem_proto;
|
extern const struct bpf_func_proto bpf_map_lookup_elem_proto;
|
||||||
|
|
Loading…
Add table
Reference in a new issue