mirror of https://gitee.com/openkylin/linux.git
sock: Move sock_valbool_flag to header
This is preparation for usage in bpf_setsockopt. Signed-off-by: Dmitry Yakunin <zeil@yandex-team.ru> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Martin KaFai Lau <kafai@fb.com> Link: https://lore.kernel.org/bpf/20200620153052.9439-1-zeil@yandex-team.ru
This commit is contained in:
parent
fea549b030
commit
dfde1d7dee
|
@ -879,6 +879,15 @@ static inline void sock_reset_flag(struct sock *sk, enum sock_flags flag)
|
|||
__clear_bit(flag, &sk->sk_flags);
|
||||
}
|
||||
|
||||
static inline void sock_valbool_flag(struct sock *sk, enum sock_flags bit,
|
||||
int valbool)
|
||||
{
|
||||
if (valbool)
|
||||
sock_set_flag(sk, bit);
|
||||
else
|
||||
sock_reset_flag(sk, bit);
|
||||
}
|
||||
|
||||
static inline bool sock_flag(const struct sock *sk, enum sock_flags flag)
|
||||
{
|
||||
return test_bit(flag, &sk->sk_flags);
|
||||
|
|
|
@ -695,15 +695,6 @@ static int sock_getbindtodevice(struct sock *sk, char __user *optval,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline void sock_valbool_flag(struct sock *sk, enum sock_flags bit,
|
||||
int valbool)
|
||||
{
|
||||
if (valbool)
|
||||
sock_set_flag(sk, bit);
|
||||
else
|
||||
sock_reset_flag(sk, bit);
|
||||
}
|
||||
|
||||
bool sk_mc_loop(struct sock *sk)
|
||||
{
|
||||
if (dev_recursion_level())
|
||||
|
|
Loading…
Reference in New Issue