Skip to content

Commit

Permalink
sock: Add sock_owned_by_user_nocheck
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tom Herbert authored and David S. Miller committed Dec 28, 2017
1 parent f72c4ac commit 602f7a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/net/sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 602f7a2

Please sign in to comment.