diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-22 22:48:48 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-22 22:48:48 -0500 |
commit | c86373faa01918197f4996eb155e188a0ab5b58b (patch) | |
tree | 72e6fd110b864612e647cc9f05ae22035de650c4 /net/unix/af_unix.c | |
parent | 4df1a32675f62275ae04f03225c897340d0cca23 (diff) |
net: convert to lock_cmp_fn
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'net/unix/af_unix.c')
-rw-r--r-- | net/unix/af_unix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index ac1f2bc18fc9..1587cfe0f881 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c @@ -170,7 +170,7 @@ static void unix_table_double_lock(struct net *net, swap(hash1, hash2); spin_lock(&net->unx.table.locks[hash1]); - spin_lock_nested(&net->unx.table.locks[hash2], SINGLE_DEPTH_NESTING); + spin_lock(&net->unx.table.locks[hash2]); } static void unix_table_double_unlock(struct net *net, @@ -706,10 +706,10 @@ static void copy_peercred(struct sock *sk, struct sock *peersk) if (sk < peersk) { spin_lock(&sk->sk_peer_lock); - spin_lock_nested(&peersk->sk_peer_lock, SINGLE_DEPTH_NESTING); + spin_lock(&peersk->sk_peer_lock); } else { spin_lock(&peersk->sk_peer_lock); - spin_lock_nested(&sk->sk_peer_lock, SINGLE_DEPTH_NESTING); + spin_lock(&sk->sk_peer_lock); } old_pid = sk->sk_peer_pid; old_cred = sk->sk_peer_cred; @@ -3575,6 +3575,7 @@ static int __net_init unix_net_init(struct net *net) for (i = 0; i < UNIX_HASH_SIZE; i++) { spin_lock_init(&net->unx.table.locks[i]); + lock_set_cmp_fn_ptr_order(&net->unx.table.locks[i]); INIT_HLIST_HEAD(&net->unx.table.buckets[i]); } |