bpf: export bpf_map_inc_not_zero
authorStanislav Fomichev <sdf@google.com>
Wed, 14 Aug 2019 17:37:48 +0000 (10:37 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Sat, 17 Aug 2019 21:18:54 +0000 (23:18 +0200)
commitb0e4701ce15d0381cdea0643c7f0a35dc529cec2
tree35f71eca49d4baa3ce31be4c830db41f60f2cb32
parentfae55527ac1164b66bee983a4d82ade2bfedb332
bpf: export bpf_map_inc_not_zero

Rename existing bpf_map_inc_not_zero to __bpf_map_inc_not_zero to
indicate that it's caller's responsibility to do proper locking.
Create and export bpf_map_inc_not_zero wrapper that properly
locks map_idr_lock. Will be used in the next commit to
hold a map while cloning a socket.

Cc: Martin KaFai Lau <kafai@fb.com>
Cc: Yonghong Song <yhs@fb.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
include/linux/bpf.h
kernel/bpf/syscall.c