From patchwork Mon Jan 20 11:27:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wangweidong X-Patchwork-Id: 312507 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8F1762C0090 for ; Mon, 20 Jan 2014 22:28:16 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbaATL2M (ORCPT ); Mon, 20 Jan 2014 06:28:12 -0500 Received: from szxga02-in.huawei.com ([119.145.14.65]:38632 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752035AbaATL2J (ORCPT ); Mon, 20 Jan 2014 06:28:09 -0500 Received: from 172.24.2.119 (EHLO szxeml205-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id BOV87083; Mon, 20 Jan 2014 19:27:35 +0800 (CST) Received: from SZXEML410-HUB.china.huawei.com (10.82.67.137) by szxeml205-edg.china.huawei.com (172.24.2.58) with Microsoft SMTP Server (TLS) id 14.3.158.1; Mon, 20 Jan 2014 19:27:33 +0800 Received: from localhost (10.177.18.75) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.3.158.1; Mon, 20 Jan 2014 19:27:31 +0800 From: Wang Weidong To: , , CC: , , 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 Message-ID: <1390217247-9408-3-git-send-email-wangweidong1@huawei.com> X-Mailer: git-send-email 1.8.1.msysgit.1 In-Reply-To: <1390217247-9408-1-git-send-email-wangweidong1@huawei.com> References: <1390217247-9408-1-git-send-email-wangweidong1@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.177.18.75] X-CFilter-Loop: Reflected Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org While we have the macros sctp_read_[un]lock, so use them. Signed-off-by: Wang Weidong --- 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;