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>
This commit is contained in:
wangweidong 2014-01-21 15:44:08 +08:00 committed by David S. Miller
parent 79b91130a2
commit 3c8e43ba9f
2 changed files with 10 additions and 12 deletions

View file

@ -171,8 +171,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
*/ */
/* spin lock wrappers. */ /* spin lock wrappers. */
#define sctp_spin_lock(lock) spin_lock(lock)
#define sctp_spin_unlock(lock) spin_unlock(lock)
#define sctp_write_lock(lock) write_lock(lock) #define sctp_write_lock(lock) write_lock(lock)
#define sctp_write_unlock(lock) write_unlock(lock) #define sctp_write_unlock(lock) write_unlock(lock)
#define sctp_read_lock(lock) read_lock(lock) #define sctp_read_lock(lock) read_lock(lock)
@ -349,11 +347,11 @@ static inline void sctp_skb_list_tail(struct sk_buff_head *list,
unsigned long flags; unsigned long flags;
spin_lock_irqsave(&head->lock, flags); spin_lock_irqsave(&head->lock, flags);
sctp_spin_lock(&list->lock); spin_lock(&list->lock);
skb_queue_splice_tail_init(list, head); skb_queue_splice_tail_init(list, head);
sctp_spin_unlock(&list->lock); spin_unlock(&list->lock);
spin_unlock_irqrestore(&head->lock, flags); spin_unlock_irqrestore(&head->lock, flags);
} }

View file

@ -5937,14 +5937,14 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
continue; continue;
index = sctp_phashfn(sock_net(sk), rover); index = sctp_phashfn(sock_net(sk), rover);
head = &sctp_port_hashtable[index]; head = &sctp_port_hashtable[index];
sctp_spin_lock(&head->lock); spin_lock(&head->lock);
sctp_for_each_hentry(pp, &head->chain) sctp_for_each_hentry(pp, &head->chain)
if ((pp->port == rover) && if ((pp->port == rover) &&
net_eq(sock_net(sk), pp->net)) net_eq(sock_net(sk), pp->net))
goto next; goto next;
break; break;
next: next:
sctp_spin_unlock(&head->lock); spin_unlock(&head->lock);
} while (--remaining > 0); } while (--remaining > 0);
/* Exhausted local port range during search? */ /* Exhausted local port range during search? */
@ -5965,7 +5965,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
* port iterator, pp being NULL. * port iterator, pp being NULL.
*/ */
head = &sctp_port_hashtable[sctp_phashfn(sock_net(sk), snum)]; head = &sctp_port_hashtable[sctp_phashfn(sock_net(sk), snum)];
sctp_spin_lock(&head->lock); spin_lock(&head->lock);
sctp_for_each_hentry(pp, &head->chain) { sctp_for_each_hentry(pp, &head->chain) {
if ((pp->port == snum) && net_eq(pp->net, sock_net(sk))) if ((pp->port == snum) && net_eq(pp->net, sock_net(sk)))
goto pp_found; goto pp_found;
@ -6049,7 +6049,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
ret = 0; ret = 0;
fail_unlock: fail_unlock:
sctp_spin_unlock(&head->lock); spin_unlock(&head->lock);
fail: fail:
local_bh_enable(); local_bh_enable();
@ -6286,13 +6286,13 @@ static inline void __sctp_put_port(struct sock *sk)
inet_sk(sk)->inet_num)]; inet_sk(sk)->inet_num)];
struct sctp_bind_bucket *pp; struct sctp_bind_bucket *pp;
sctp_spin_lock(&head->lock); spin_lock(&head->lock);
pp = sctp_sk(sk)->bind_hash; pp = sctp_sk(sk)->bind_hash;
__sk_del_bind_node(sk); __sk_del_bind_node(sk);
sctp_sk(sk)->bind_hash = NULL; sctp_sk(sk)->bind_hash = NULL;
inet_sk(sk)->inet_num = 0; inet_sk(sk)->inet_num = 0;
sctp_bucket_destroy(pp); sctp_bucket_destroy(pp);
sctp_spin_unlock(&head->lock); spin_unlock(&head->lock);
} }
void sctp_put_port(struct sock *sk) void sctp_put_port(struct sock *sk)
@ -6951,12 +6951,12 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
head = &sctp_port_hashtable[sctp_phashfn(sock_net(oldsk), head = &sctp_port_hashtable[sctp_phashfn(sock_net(oldsk),
inet_sk(oldsk)->inet_num)]; inet_sk(oldsk)->inet_num)];
local_bh_disable(); local_bh_disable();
sctp_spin_lock(&head->lock); spin_lock(&head->lock);
pp = sctp_sk(oldsk)->bind_hash; pp = sctp_sk(oldsk)->bind_hash;
sk_add_bind_node(newsk, &pp->owner); sk_add_bind_node(newsk, &pp->owner);
sctp_sk(newsk)->bind_hash = pp; sctp_sk(newsk)->bind_hash = pp;
inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num; inet_sk(newsk)->inet_num = inet_sk(oldsk)->inet_num;
sctp_spin_unlock(&head->lock); spin_unlock(&head->lock);
local_bh_enable(); local_bh_enable();
/* Copy the bind_addr list from the original endpoint to the new /* Copy the bind_addr list from the original endpoint to the new