mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 14:11:20 +00:00
net: add annotation for sock_{lock,unlock}_fast
The static checker is fooled by the non-static locking scheme implemented by the mentioned helpers. Let's make its life easier adding some unconditional annotation so that the helpers are now interpreted as a plain spinlock from sparse. v1 -> v2: - add __releases() annotation to unlock_sock_fast() Signed-off-by: Paolo Abeni <pabeni@redhat.com> Link: https://lore.kernel.org/r/6ed7ae627d8271fb7f20e0a9c6750fbba1ac2635.1605634911.git.pabeni@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
c3bc2adb05
commit
12f4bd8622
2 changed files with 9 additions and 4 deletions
|
@ -3078,7 +3078,7 @@ EXPORT_SYMBOL(release_sock);
|
|||
*
|
||||
* sk_lock.slock unlocked, owned = 1, BH enabled
|
||||
*/
|
||||
bool lock_sock_fast(struct sock *sk)
|
||||
bool lock_sock_fast(struct sock *sk) __acquires(&sk->sk_lock.slock)
|
||||
{
|
||||
might_sleep();
|
||||
spin_lock_bh(&sk->sk_lock.slock);
|
||||
|
@ -3096,6 +3096,7 @@ bool lock_sock_fast(struct sock *sk)
|
|||
* The sk_lock has mutex_lock() semantics here:
|
||||
*/
|
||||
mutex_acquire(&sk->sk_lock.dep_map, 0, 0, _RET_IP_);
|
||||
__acquire(&sk->sk_lock.slock);
|
||||
local_bh_enable();
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue