mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[AF_UNIX]: Make socket locking much less confusing.
The unix_state_*() locking macros imply that there is some rwlock kind of thing going on, but the implementation is actually a spinlock which makes the code more confusing than it needs to be. So use plain unix_state_lock and unix_state_unlock. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c1a13ff57a
commit
1c92b4e50e
2 changed files with 50 additions and 52 deletions
|
@ -62,13 +62,11 @@ struct unix_skb_parms {
|
|||
#define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
|
||||
#define UNIXSID(skb) (&UNIXCB((skb)).secid)
|
||||
|
||||
#define unix_state_rlock(s) spin_lock(&unix_sk(s)->lock)
|
||||
#define unix_state_runlock(s) spin_unlock(&unix_sk(s)->lock)
|
||||
#define unix_state_wlock(s) spin_lock(&unix_sk(s)->lock)
|
||||
#define unix_state_wlock_nested(s) \
|
||||
#define unix_state_lock(s) spin_lock(&unix_sk(s)->lock)
|
||||
#define unix_state_unlock(s) spin_unlock(&unix_sk(s)->lock)
|
||||
#define unix_state_lock_nested(s) \
|
||||
spin_lock_nested(&unix_sk(s)->lock, \
|
||||
SINGLE_DEPTH_NESTING)
|
||||
#define unix_state_wunlock(s) spin_unlock(&unix_sk(s)->lock)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
/* The AF_UNIX socket */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue