Blob Blame History Raw
From: Tom Herbert <tom@quantonium.net>
Date: Thu, 28 Dec 2017 11:00:43 -0800
Subject: sock: Add sock_owned_by_user_nocheck
Patch-mainline: v4.15-rc6
Git-commit: 602f7a2714a3b3aa4bec82ab0a86a9f5a2c4aa61
References: bsc#1076830

This allows checking socket lock ownership with producing lockdep
warnings.

Signed-off-by: Tom Herbert <tom@quantonium.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Michal Kubecek <mkubecek@suse.cz>

---
 include/net/sock.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/net/sock.h b/include/net/sock.h
index cbc6d96ea4c9..e9a544435432 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1524,6 +1524,11 @@ static inline bool sock_owned_by_user(const struct sock *sk)
 	return sk->sk_lock.owned;
 }
 
+static inline bool sock_owned_by_user_nocheck(const struct sock *sk)
+{
+	return sk->sk_lock.owned;
+}
+
 /* no reclassification while locks are held */
 static inline bool sock_allow_reclassification(const struct sock *csk)
 {
-- 
2.16.2