Skip to content

Commit 3c8e43b

Browse files
wangweidongdavem330
authored andcommitted
sctp: remove macros sctp_spin_[un]lock
Redefined spin_[un]lock to sctp_spin_[un]lock for user space friendly code which we haven't use in years, so removing them. Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 79b9113 commit 3c8e43b

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

‎include/net/sctp/sctp.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
171171
*/
172172

173173
/* spin lock wrappers. */
174-
#define sctp_spin_lock(lock) spin_lock(lock)
175-
#define sctp_spin_unlock(lock) spin_unlock(lock)
176174
#define sctp_write_lock(lock) write_lock(lock)
177175
#define sctp_write_unlock(lock) write_unlock(lock)
178176
#define sctp_read_lock(lock) read_lock(lock)
@@ -349,11 +347,11 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
349347
unsigned long flags;
350348

351349
spin_lock_irqsave(&head->lock, flags);
352-
sctp_spin_lock(&list->lock);
350+
spin_lock(&list->lock);
353351

354352
skb_queue_splice_tail_init(list, head);
355353

356-
sctp_spin_unlock(&list->lock);
354+
spin_unlock(&list->lock);
357355
spin_unlock_irqrestore(&head->lock, flags);
358356
}
359357

‎net/sctp/socket.c‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5937,14 +5937,14 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
59375937
continue;
59385938
index = sctp_phashfn(sock_net(sk), rover);
59395939
head = &sctp_port_hashtable[index];
5940-
sctp_spin_lock(&head->lock);
5940+
spin_lock(&head->lock);
59415941
sctp_for_each_hentry(pp, &head->chain)
59425942
if ((pp->port == rover) &&
59435943
net_eq(sock_net(sk), pp->net))
59445944
goto next;
59455945
break;
59465946
next:
5947-
sctp_spin_unlock(&head->lock);
5947+
spin_unlock(&head->lock);
59485948
} while (--remaining > 0);
59495949

59505950
/* Exhausted local port range during search? */
@@ -5965,7 +5965,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
59655965
* port iterator, pp being NULL.
59665966
*/
59675967
head = &sctp_port_hashtable[sctp_phashfn(sock_net(sk), snum)];
5968-
sctp_spin_lock(&head->lock);
5968+
spin_lock(&head->lock);
59695969
sctp_for_each_hentry(pp, &head->chain) {
59705970
if ((pp->port == snum) && net_eq(pp->net, sock_net(sk)))
59715971
goto pp_found;
@@ -6049,7 +6049,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
60496049
ret = 0;
60506050

60516051
fail_unlock:
6052-
sctp_spin_unlock(&head->lock);
6052+
spin_unlock(&head->lock);
60536053

60546054
fail:
60556055
local_bh_enable();
@@ -6286,13 +6286,13 @@ static inline void __sctp_put_port(struct sock *sk)
62866286
inet_sk(sk)->inet_num)];
62876287
struct sctp_bind_bucket *pp;
62886288

6289-
sctp_spin_lock(&head->lock);
6289+
spin_lock(&head->lock);
62906290
pp = sctp_sk(sk)->bind_hash;
62916291
__sk_del_bind_node(sk);
62926292
sctp_sk(sk)->bind_hash = NULL;
62936293
inet_sk(sk)->inet_num = 0;
62946294
sctp_bucket_destroy(pp);
6295-
sctp_spin_unlock(&head->lock);
6295+
spin_unlock(&head->lock);
62966296
}
62976297

62986298
void sctp_put_port(struct sock *sk)
@@ -6951,12 +6951,12 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
69516951
head = &sctp_port_hashtable[sctp_phashfn(sock_net(oldsk),
69526952
inet_sk(oldsk)->inet_num)];
69536953
local_bh_disable();
6954-
sctp_spin_lock(&head->lock);
6954+
spin_lock(&head->lock);
69556955
pp = sctp_sk(oldsk)->bind_hash;
69566956
sk_add_bind_node(newsk, &pp->owner);
69576957
sctp_sk(newsk)->bind_hash = pp;
69586958
inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num;
6959-
sctp_spin_unlock(&head->lock);
6959+
spin_unlock(&head->lock);
69606960
local_bh_enable();
69616961

69626962
/* Copy the bind_addr list from the original endpoint to the new

0 commit comments

Comments
 (0)