Commit 79b91130 authored by wangweidong's avatar wangweidong Committed by David S. Miller

sctp: remove macros sctp_local_bh_{disable|enable}

Redefined local_bh_{disable|enable} to sctp_local_bh_{disable|enable}
for user space friendly code which we haven't use in years, so removing them.
Signed-off-by: default avatarWang Weidong <wangweidong1@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 940287ee
...@@ -171,8 +171,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly; ...@@ -171,8 +171,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
*/ */
/* spin lock wrappers. */ /* spin lock wrappers. */
#define sctp_local_bh_disable() local_bh_disable()
#define sctp_local_bh_enable() local_bh_enable()
#define sctp_spin_lock(lock) spin_lock(lock) #define sctp_spin_lock(lock) spin_lock(lock)
#define sctp_spin_unlock(lock) spin_unlock(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)
......
...@@ -368,9 +368,9 @@ struct sctp_association *sctp_endpoint_lookup_assoc( ...@@ -368,9 +368,9 @@ struct sctp_association *sctp_endpoint_lookup_assoc(
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
sctp_local_bh_disable(); local_bh_disable();
asoc = __sctp_endpoint_lookup_assoc(ep, paddr, transport); asoc = __sctp_endpoint_lookup_assoc(ep, paddr, transport);
sctp_local_bh_enable(); local_bh_enable();
return asoc; return asoc;
} }
......
...@@ -726,9 +726,9 @@ static void __sctp_hash_endpoint(struct sctp_endpoint *ep) ...@@ -726,9 +726,9 @@ static void __sctp_hash_endpoint(struct sctp_endpoint *ep)
/* Add an endpoint to the hash. Local BH-safe. */ /* Add an endpoint to the hash. Local BH-safe. */
void sctp_hash_endpoint(struct sctp_endpoint *ep) void sctp_hash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_local_bh_disable(); local_bh_disable();
__sctp_hash_endpoint(ep); __sctp_hash_endpoint(ep);
sctp_local_bh_enable(); local_bh_enable();
} }
/* Remove endpoint from the hash table. */ /* Remove endpoint from the hash table. */
...@@ -752,9 +752,9 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep) ...@@ -752,9 +752,9 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
/* Remove endpoint from the hash. Local BH-safe. */ /* Remove endpoint from the hash. Local BH-safe. */
void sctp_unhash_endpoint(struct sctp_endpoint *ep) void sctp_unhash_endpoint(struct sctp_endpoint *ep)
{ {
sctp_local_bh_disable(); local_bh_disable();
__sctp_unhash_endpoint(ep); __sctp_unhash_endpoint(ep);
sctp_local_bh_enable(); local_bh_enable();
} }
/* Look up an endpoint. */ /* Look up an endpoint. */
...@@ -809,9 +809,9 @@ void sctp_hash_established(struct sctp_association *asoc) ...@@ -809,9 +809,9 @@ void sctp_hash_established(struct sctp_association *asoc)
if (asoc->temp) if (asoc->temp)
return; return;
sctp_local_bh_disable(); local_bh_disable();
__sctp_hash_established(asoc); __sctp_hash_established(asoc);
sctp_local_bh_enable(); local_bh_enable();
} }
/* Remove association from the hash table. */ /* Remove association from the hash table. */
...@@ -839,9 +839,9 @@ void sctp_unhash_established(struct sctp_association *asoc) ...@@ -839,9 +839,9 @@ void sctp_unhash_established(struct sctp_association *asoc)
if (asoc->temp) if (asoc->temp)
return; return;
sctp_local_bh_disable(); local_bh_disable();
__sctp_unhash_established(asoc); __sctp_unhash_established(asoc);
sctp_local_bh_enable(); local_bh_enable();
} }
/* Look up an association. */ /* Look up an association. */
...@@ -891,9 +891,9 @@ struct sctp_association *sctp_lookup_association(struct net *net, ...@@ -891,9 +891,9 @@ struct sctp_association *sctp_lookup_association(struct net *net,
{ {
struct sctp_association *asoc; struct sctp_association *asoc;
sctp_local_bh_disable(); local_bh_disable();
asoc = __sctp_lookup_association(net, laddr, paddr, transportp); asoc = __sctp_lookup_association(net, laddr, paddr, transportp);
sctp_local_bh_enable(); local_bh_enable();
return asoc; return asoc;
} }
......
...@@ -218,7 +218,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v) ...@@ -218,7 +218,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
return -ENOMEM; return -ENOMEM;
head = &sctp_ep_hashtable[hash]; head = &sctp_ep_hashtable[hash];
sctp_local_bh_disable(); local_bh_disable();
read_lock(&head->lock); read_lock(&head->lock);
sctp_for_each_hentry(epb, &head->chain) { sctp_for_each_hentry(epb, &head->chain) {
ep = sctp_ep(epb); ep = sctp_ep(epb);
...@@ -235,7 +235,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v) ...@@ -235,7 +235,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "\n"); seq_printf(seq, "\n");
} }
read_unlock(&head->lock); read_unlock(&head->lock);
sctp_local_bh_enable(); local_bh_enable();
return 0; return 0;
} }
...@@ -326,7 +326,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) ...@@ -326,7 +326,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
return -ENOMEM; return -ENOMEM;
head = &sctp_assoc_hashtable[hash]; head = &sctp_assoc_hashtable[hash];
sctp_local_bh_disable(); local_bh_disable();
read_lock(&head->lock); read_lock(&head->lock);
sctp_for_each_hentry(epb, &head->chain) { sctp_for_each_hentry(epb, &head->chain) {
assoc = sctp_assoc(epb); assoc = sctp_assoc(epb);
...@@ -362,7 +362,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v) ...@@ -362,7 +362,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "\n"); seq_printf(seq, "\n");
} }
read_unlock(&head->lock); read_unlock(&head->lock);
sctp_local_bh_enable(); local_bh_enable();
return 0; return 0;
} }
...@@ -446,7 +446,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) ...@@ -446,7 +446,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
return -ENOMEM; return -ENOMEM;
head = &sctp_assoc_hashtable[hash]; head = &sctp_assoc_hashtable[hash];
sctp_local_bh_disable(); local_bh_disable();
read_lock(&head->lock); read_lock(&head->lock);
rcu_read_lock(); rcu_read_lock();
sctp_for_each_hentry(epb, &head->chain) { sctp_for_each_hentry(epb, &head->chain) {
...@@ -505,7 +505,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v) ...@@ -505,7 +505,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
rcu_read_unlock(); rcu_read_unlock();
read_unlock(&head->lock); read_unlock(&head->lock);
sctp_local_bh_enable(); local_bh_enable();
return 0; return 0;
......
...@@ -1510,7 +1510,7 @@ static void sctp_close(struct sock *sk, long timeout) ...@@ -1510,7 +1510,7 @@ static void sctp_close(struct sock *sk, long timeout)
/* Supposedly, no process has access to the socket, but /* Supposedly, no process has access to the socket, but
* the net layers still may. * the net layers still may.
*/ */
sctp_local_bh_disable(); local_bh_disable();
sctp_bh_lock_sock(sk); sctp_bh_lock_sock(sk);
/* Hold the sock, since sk_common_release() will put sock_put() /* Hold the sock, since sk_common_release() will put sock_put()
...@@ -1520,7 +1520,7 @@ static void sctp_close(struct sock *sk, long timeout) ...@@ -1520,7 +1520,7 @@ static void sctp_close(struct sock *sk, long timeout)
sk_common_release(sk); sk_common_release(sk);
sctp_bh_unlock_sock(sk); sctp_bh_unlock_sock(sk);
sctp_local_bh_enable(); local_bh_enable();
sock_put(sk); sock_put(sk);
...@@ -5918,7 +5918,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr) ...@@ -5918,7 +5918,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
pr_debug("%s: begins, snum:%d\n", __func__, snum); pr_debug("%s: begins, snum:%d\n", __func__, snum);
sctp_local_bh_disable(); local_bh_disable();
if (snum == 0) { if (snum == 0) {
/* Search for an available port. */ /* Search for an available port. */
...@@ -6052,7 +6052,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr) ...@@ -6052,7 +6052,7 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
sctp_spin_unlock(&head->lock); sctp_spin_unlock(&head->lock);
fail: fail:
sctp_local_bh_enable(); local_bh_enable();
return ret; return ret;
} }
...@@ -6297,9 +6297,9 @@ static inline void __sctp_put_port(struct sock *sk) ...@@ -6297,9 +6297,9 @@ static inline void __sctp_put_port(struct sock *sk)
void sctp_put_port(struct sock *sk) void sctp_put_port(struct sock *sk)
{ {
sctp_local_bh_disable(); local_bh_disable();
__sctp_put_port(sk); __sctp_put_port(sk);
sctp_local_bh_enable(); local_bh_enable();
} }
/* /*
...@@ -6950,14 +6950,14 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, ...@@ -6950,14 +6950,14 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk,
/* Hook this new socket in to the bind_hash list. */ /* Hook this new socket in to the bind_hash list. */
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)];
sctp_local_bh_disable(); local_bh_disable();
sctp_spin_lock(&head->lock); sctp_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); sctp_spin_unlock(&head->lock);
sctp_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
* endpoint so that we can handle restarts properly * endpoint so that we can handle restarts properly
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment