diff options
Diffstat (limited to 'backport-include/net/sock.h')
-rw-r--r-- | backport-include/net/sock.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/backport-include/net/sock.h b/backport-include/net/sock.h index 39bf008..cc037cf 100644 --- a/backport-include/net/sock.h +++ b/backport-include/net/sock.h @@ -75,4 +75,14 @@ static inline void sk_pacing_shift_update(struct sock *sk, int val) } #endif /* < 4.16 */ +#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 */ |