summaryrefslogtreecommitdiff
path: root/backport-include/net/sock.h
diff options
context:
space:
mode:
authorDominik Sliwa <dominik.sliwa@toradex.com>2017-12-22 12:07:34 +0000
committerDominik Sliwa <dominik.sliwa@toradex.com>2018-09-18 17:15:11 +0200
commit69ff0b5709d0d06545fcb2d08c7645b56d3687dd (patch)
tree71f1569cc019e16c1b1be22c1e8d382766daebb3 /backport-include/net/sock.h
parentd6a47bfb72f495a72637fbe635220f6af0f4cb6f (diff)
backports: bluetooth: Support 4.9 kernels
Signed-off-by: Dominik Sliwa <dominik.sliwa@toradex.com>
Diffstat (limited to 'backport-include/net/sock.h')
-rw-r--r--backport-include/net/sock.h10
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 */