From 198e79f0e8f0b24c1e36ab6032d348f40de20262 Mon Sep 17 00:00:00 2001 From: Dominik Sliwa Date: Fri, 22 Dec 2017 12:07:34 +0000 Subject: backports: bluetooth: Support 4.9 kernels Signed-off-by: Dominik Sliwa --- backport-include/net/sock.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backport-include/net/sock.h') diff --git a/backport-include/net/sock.h b/backport-include/net/sock.h index 89191f3..ea3c474 100644 --- a/backport-include/net/sock.h +++ b/backport-include/net/sock.h @@ -63,4 +63,14 @@ static inline void sk_clear_bit(int nr, struct sock *sk) } #endif /* < 4.5 */ +#if LINUX_VERSION_IS_LESS(4,7,0) +/* no reclassification while locks are held */ +static inline bool sock_allow_reclassification(const struct sock *csk) +{ + struct sock *sk = (struct sock *)csk; + + return !sk->sk_lock.owned && !spin_is_locked(&sk->sk_lock.slock); +} +#endif /* < 4.7 */ + #endif /* __BACKPORT_NET_SOCK_H */ -- cgit v1.2.3