netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Weidong <wangweidong1@huawei.com>
To: <nhorman@tuxdriver.com>, <davem@davemloft.net>, <vyasevich@gmail.com>
Cc: <dborkman@redhat.com>, <netdev@vger.kernel.org>,
	<linux-sctp@vger.kernel.org>
Subject: [PATCH net-next 2/2] sctp: use sctp_read_[un]lock instead of read_[un]lock
Date: Mon, 20 Jan 2014 19:27:27 +0800	[thread overview]
Message-ID: <1390217247-9408-3-git-send-email-wangweidong1@huawei.com> (raw)
In-Reply-To: <1390217247-9408-1-git-send-email-wangweidong1@huawei.com>

While we have the macros sctp_read_[un]lock, so use them.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
---
 net/sctp/endpointola.c |  4 ++--
 net/sctp/input.c       | 10 +++++-----
 net/sctp/proc.c        | 12 ++++++------
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 6ffb6c1..68e1f91 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -342,7 +342,7 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
 	hash = sctp_assoc_hashfn(sock_net(ep->base.sk), ep->base.bind_addr.port,
 				 rport);
 	head = &sctp_assoc_hashtable[hash];
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	sctp_for_each_hentry(epb, &head->chain) {
 		tmp = sctp_assoc(epb);
 		if (tmp->ep != ep || rport != tmp->peer.port)
@@ -355,7 +355,7 @@ static struct sctp_association *__sctp_endpoint_lookup_assoc(
 			break;
 		}
 	}
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 out:
 	return asoc;
 }
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 1f4eeb4..f22669c 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -768,7 +768,7 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(struct net *net,
 
 	hash = sctp_ep_hashfn(net, ntohs(laddr->v4.sin_port));
 	head = &sctp_ep_hashtable[hash];
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	sctp_for_each_hentry(epb, &head->chain) {
 		ep = sctp_ep(epb);
 		if (sctp_endpoint_is_match(ep, net, laddr))
@@ -779,7 +779,7 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(struct net *net,
 
 hit:
 	sctp_endpoint_hold(ep);
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 	return ep;
 }
 
@@ -863,7 +863,7 @@ static struct sctp_association *__sctp_lookup_association(
 	hash = sctp_assoc_hashfn(net, ntohs(local->v4.sin_port),
 				 ntohs(peer->v4.sin_port));
 	head = &sctp_assoc_hashtable[hash];
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	sctp_for_each_hentry(epb, &head->chain) {
 		asoc = sctp_assoc(epb);
 		transport = sctp_assoc_is_match(asoc, net, local, peer);
@@ -871,14 +871,14 @@ static struct sctp_association *__sctp_lookup_association(
 			goto hit;
 	}
 
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 
 	return NULL;
 
 hit:
 	*pt = transport;
 	sctp_association_hold(asoc);
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 	return asoc;
 }
 
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index 63ba0bd..bbba718 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -219,7 +219,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 
 	head = &sctp_ep_hashtable[hash];
 	sctp_local_bh_disable();
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	sctp_for_each_hentry(epb, &head->chain) {
 		ep = sctp_ep(epb);
 		sk = epb->sk;
@@ -234,7 +234,7 @@ static int sctp_eps_seq_show(struct seq_file *seq, void *v)
 		sctp_seq_dump_local_addrs(seq, epb);
 		seq_printf(seq, "\n");
 	}
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 	sctp_local_bh_enable();
 
 	return 0;
@@ -327,7 +327,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 
 	head = &sctp_assoc_hashtable[hash];
 	sctp_local_bh_disable();
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	sctp_for_each_hentry(epb, &head->chain) {
 		assoc = sctp_assoc(epb);
 		sk = epb->sk;
@@ -361,7 +361,7 @@ static int sctp_assocs_seq_show(struct seq_file *seq, void *v)
 			sk->sk_rcvbuf);
 		seq_printf(seq, "\n");
 	}
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 	sctp_local_bh_enable();
 
 	return 0;
@@ -447,7 +447,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 
 	head = &sctp_assoc_hashtable[hash];
 	sctp_local_bh_disable();
-	read_lock(&head->lock);
+	sctp_read_lock(&head->lock);
 	rcu_read_lock();
 	sctp_for_each_hentry(epb, &head->chain) {
 		if (!net_eq(sock_net(epb->sk), seq_file_net(seq)))
@@ -504,7 +504,7 @@ static int sctp_remaddr_seq_show(struct seq_file *seq, void *v)
 	}
 
 	rcu_read_unlock();
-	read_unlock(&head->lock);
+	sctp_read_unlock(&head->lock);
 	sctp_local_bh_enable();
 
 	return 0;
-- 
1.7.12

  parent reply	other threads:[~2014-01-20 11:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-20 11:27 [PATCH net-next 0/2] sctp: some small clean ups Wang Weidong
2014-01-20 11:27 ` [PATCH net-next 1/2] sctp: use sctp_local_bh_{disable|enable} instead local_bh_{disable|enable} Wang Weidong
2014-01-20 11:27 ` Wang Weidong [this message]
2014-01-20 11:37 ` [PATCH net-next 0/2] sctp: some small clean ups Daniel Borkmann
2014-01-20 12:06   ` Wang Weidong
2014-01-20 12:20   ` Neil Horman
2014-01-20 12:32     ` Wang Weidong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1390217247-9408-3-git-send-email-wangweidong1@huawei.com \
    --to=wangweidong1@huawei.com \
    --cc=davem@davemloft.net \
    --cc=dborkman@redhat.com \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    --cc=vyasevich@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).