1
0
Fork 0
alistair23-linux/drivers/isdn/i4l
Alexei Starovoitov 7ae457c1e5 net: filter: split 'struct sk_filter' into socket and bpf parts
clean up names related to socket filtering and bpf in the following way:
- everything that deals with sockets keeps 'sk_*' prefix
- everything that is pure BPF is changed to 'bpf_*' prefix

split 'struct sk_filter' into
struct sk_filter {
	atomic_t        refcnt;
	struct rcu_head rcu;
	struct bpf_prog *prog;
};
and
struct bpf_prog {
        u32                     jited:1,
                                len:31;
        struct sock_fprog_kern  *orig_prog;
        unsigned int            (*bpf_func)(const struct sk_buff *skb,
                                            const struct bpf_insn *filter);
        union {
                struct sock_filter      insns[0];
                struct bpf_insn         insnsi[0];
                struct work_struct      work;
        };
};
so that 'struct bpf_prog' can be used independent of sockets and cleans up
'unattached' bpf use cases

split SK_RUN_FILTER macro into:
    SK_RUN_FILTER to be used with 'struct sk_filter *' and
    BPF_PROG_RUN to be used with 'struct bpf_prog *'

__sk_filter_release(struct sk_filter *) gains
__bpf_prog_release(struct bpf_prog *) helper function

also perform related renames for the functions that work
with 'struct bpf_prog *', since they're on the same lines:

sk_filter_size -> bpf_prog_size
sk_filter_select_runtime -> bpf_prog_select_runtime
sk_filter_free -> bpf_prog_free
sk_unattached_filter_create -> bpf_prog_create
sk_unattached_filter_destroy -> bpf_prog_destroy
sk_store_orig_filter -> bpf_prog_store_orig_filter
sk_release_orig_filter -> bpf_release_orig_filter
__sk_migrate_filter -> bpf_migrate_filter
__sk_prepare_filter -> bpf_prepare_filter

API for attaching classic BPF to a socket stays the same:
sk_attach_filter(prog, struct sock *)/sk_detach_filter(struct sock *)
and SK_RUN_FILTER(struct sk_filter *, ctx) to execute a program
which is used by sockets, tun, af_packet

API for 'unattached' BPF programs becomes:
bpf_prog_create(struct bpf_prog **)/bpf_prog_destroy(struct bpf_prog *)
and BPF_PROG_RUN(struct bpf_prog *, ctx) to execute a program
which is used by isdn, ppp, team, seccomp, ptp, xt_bpf, cls_bpf, test_bpf

Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-08-02 15:03:58 -07:00
..
Kconfig isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES 2012-11-07 18:59:26 -05:00
Makefile ISDN: Make isdnhdlc usable for other ISDN drivers 2009-07-25 20:15:21 +02:00
isdn_audio.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_audio.h [PATCH] drivers/isdn/i4l/: possible cleanups 2005-06-25 16:24:56 -07:00
isdn_bsdcomp.c isdn: remove duplicate NULL check 2012-05-17 04:47:50 -04:00
isdn_common.c isdn: replace del_timer by del_timer_sync 2014-03-27 15:28:06 -04:00
isdn_common.h TTY: switch tty_insert_flip_string 2013-01-15 22:22:35 -08:00
isdn_concap.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_concap.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_net.c isdn: use constants instead of magicnumbers 2014-07-24 23:31:36 -07:00
isdn_net.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_ppp.c net: filter: split 'struct sk_filter' into socket and bpf parts 2014-08-02 15:03:58 -07:00
isdn_ppp.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_tty.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2013-04-30 09:36:50 -07:00
isdn_tty.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_ttyfax.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_ttyfax.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_v110.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_v110.h isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_x25iface.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00
isdn_x25iface.h wanrouter: completely decouple obsolete code from kernel. 2013-01-31 19:20:33 -05:00
isdnhdlc.c isdn: whitespace coding style cleanup 2012-02-21 09:04:01 -08:00