sock: Add sock_owned_by_user_nocheck
authorTom Herbert <tom@quantonium.net>
Thu, 28 Dec 2017 19:00:43 +0000 (11:00 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Dec 2017 19:28:22 +0000 (14:28 -0500)
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>
include/net/sock.h

index 9155da42269208b358df8535b14dfd3dba509365..7a7b14e9628a1174e18dda30cd0b5bfd5b32d30d 100644 (file)
@@ -1514,6 +1514,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)
 {