bpf: abstract anon_inode_getfd invocations
authorDaniel Borkmann <daniel@iogearbox.net>
Thu, 29 Oct 2015 13:58:06 +0000 (14:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Nov 2015 03:48:39 +0000 (22:48 -0500)
commitaa79781b65b9cf79807ade78f2703f5e9402c336
tree7b2eaa26b26f7c59283b87b6c44a5855dd249273
parent1d6119baf0610f813eb9d9580eb4fd16de5b4ceb
bpf: abstract anon_inode_getfd invocations

Since we're going to use anon_inode_getfd() invocations in more than just
the current places, make a helper function for both, so that we only need
to pass a map/prog pointer to the helper itself in order to get a fd. The
new helpers are called bpf_map_new_fd() and bpf_prog_new_fd().

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
kernel/bpf/syscall.c