diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2015-03-01 11:31:42 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-03-01 19:05:18 (GMT) |
commit | a2c83fff582ae133d9f5bb187404ea9ce4da1f96 (patch) | |
tree | 93293fffedc76b48e5ccaefdfd95728719d11753 /net/core | |
parent | f91fe17e243d1f279d425071a35e3d41290758a0 (diff) | |
download | linux-a2c83fff582ae133d9f5bb187404ea9ce4da1f96.tar.xz |
ebpf: constify various function pointer structs
We can move bpf_map_ops and bpf_verifier_ops and other structs into ro
section, bpf_map_type_list and bpf_prog_type_list into read mostly.
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/filter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/filter.c b/net/core/filter.c index f6bdc2b..6fe09e3 100644 --- a/net/core/filter.c +++ b/net/core/filter.c @@ -1159,19 +1159,19 @@ static bool sock_filter_is_valid_access(int off, int size, enum bpf_access_type return false; } -static struct bpf_verifier_ops sock_filter_ops = { +static const struct bpf_verifier_ops sock_filter_ops = { .get_func_proto = sock_filter_func_proto, .is_valid_access = sock_filter_is_valid_access, }; -static struct bpf_prog_type_list tl = { +static struct bpf_prog_type_list sock_filter_type __read_mostly = { .ops = &sock_filter_ops, .type = BPF_PROG_TYPE_SOCKET_FILTER, }; static int __init register_sock_filter_ops(void) { - bpf_register_prog_type(&tl); + bpf_register_prog_type(&sock_filter_type); return 0; } late_initcall(register_sock_filter_ops); |