diff options
author | Stephen Hemminger <shemminger@vyatta.com> | 2010-02-17 21:48:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 21:48:44 -0500 |
commit | 6457d26bd40077238799e31df2b800bcf4ef9177 (patch) | |
tree | 4d9f085a8f33fa5528c14cbf60678295bbe74d11 /net/ipv6/mcast.c | |
parent | dfa1a041094f4a6e5845a19a1b10e317676722e7 (diff) |
IPv6: convert mc_lock to spinlock
Only used for writing, so convert to spinlock
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/mcast.c')
-rw-r--r-- | net/ipv6/mcast.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 25f6cca79e6b..bcd971915969 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -793,10 +793,10 @@ static void mld_add_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im) | |||
793 | } | 793 | } |
794 | spin_unlock_bh(&im->mca_lock); | 794 | spin_unlock_bh(&im->mca_lock); |
795 | 795 | ||
796 | write_lock_bh(&idev->mc_lock); | 796 | spin_lock_bh(&idev->mc_lock); |
797 | pmc->next = idev->mc_tomb; | 797 | pmc->next = idev->mc_tomb; |
798 | idev->mc_tomb = pmc; | 798 | idev->mc_tomb = pmc; |
799 | write_unlock_bh(&idev->mc_lock); | 799 | spin_unlock_bh(&idev->mc_lock); |
800 | } | 800 | } |
801 | 801 | ||
802 | static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca) | 802 | static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca) |
@@ -804,7 +804,7 @@ static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca) | |||
804 | struct ifmcaddr6 *pmc, *pmc_prev; | 804 | struct ifmcaddr6 *pmc, *pmc_prev; |
805 | struct ip6_sf_list *psf, *psf_next; | 805 | struct ip6_sf_list *psf, *psf_next; |
806 | 806 | ||
807 | write_lock_bh(&idev->mc_lock); | 807 | spin_lock_bh(&idev->mc_lock); |
808 | pmc_prev = NULL; | 808 | pmc_prev = NULL; |
809 | for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { | 809 | for (pmc=idev->mc_tomb; pmc; pmc=pmc->next) { |
810 | if (ipv6_addr_equal(&pmc->mca_addr, pmca)) | 810 | if (ipv6_addr_equal(&pmc->mca_addr, pmca)) |
@@ -817,7 +817,8 @@ static void mld_del_delrec(struct inet6_dev *idev, struct in6_addr *pmca) | |||
817 | else | 817 | else |
818 | idev->mc_tomb = pmc->next; | 818 | idev->mc_tomb = pmc->next; |
819 | } | 819 | } |
820 | write_unlock_bh(&idev->mc_lock); | 820 | spin_unlock_bh(&idev->mc_lock); |
821 | |||
821 | if (pmc) { | 822 | if (pmc) { |
822 | for (psf=pmc->mca_tomb; psf; psf=psf_next) { | 823 | for (psf=pmc->mca_tomb; psf; psf=psf_next) { |
823 | psf_next = psf->sf_next; | 824 | psf_next = psf->sf_next; |
@@ -832,10 +833,10 @@ static void mld_clear_delrec(struct inet6_dev *idev) | |||
832 | { | 833 | { |
833 | struct ifmcaddr6 *pmc, *nextpmc; | 834 | struct ifmcaddr6 *pmc, *nextpmc; |
834 | 835 | ||
835 | write_lock_bh(&idev->mc_lock); | 836 | spin_lock_bh(&idev->mc_lock); |
836 | pmc = idev->mc_tomb; | 837 | pmc = idev->mc_tomb; |
837 | idev->mc_tomb = NULL; | 838 | idev->mc_tomb = NULL; |
838 | write_unlock_bh(&idev->mc_lock); | 839 | spin_unlock_bh(&idev->mc_lock); |
839 | 840 | ||
840 | for (; pmc; pmc = nextpmc) { | 841 | for (; pmc; pmc = nextpmc) { |
841 | nextpmc = pmc->next; | 842 | nextpmc = pmc->next; |
@@ -1696,7 +1697,7 @@ static void mld_send_cr(struct inet6_dev *idev) | |||
1696 | int type, dtype; | 1697 | int type, dtype; |
1697 | 1698 | ||
1698 | read_lock_bh(&idev->lock); | 1699 | read_lock_bh(&idev->lock); |
1699 | write_lock_bh(&idev->mc_lock); | 1700 | spin_lock(&idev->mc_lock); |
1700 | 1701 | ||
1701 | /* deleted MCA's */ | 1702 | /* deleted MCA's */ |
1702 | pmc_prev = NULL; | 1703 | pmc_prev = NULL; |
@@ -1730,7 +1731,7 @@ static void mld_send_cr(struct inet6_dev *idev) | |||
1730 | } else | 1731 | } else |
1731 | pmc_prev = pmc; | 1732 | pmc_prev = pmc; |
1732 | } | 1733 | } |
1733 | write_unlock_bh(&idev->mc_lock); | 1734 | spin_unlock(&idev->mc_lock); |
1734 | 1735 | ||
1735 | /* change recs */ | 1736 | /* change recs */ |
1736 | for (pmc=idev->mc_list; pmc; pmc=pmc->next) { | 1737 | for (pmc=idev->mc_list; pmc; pmc=pmc->next) { |
@@ -2311,7 +2312,7 @@ void ipv6_mc_up(struct inet6_dev *idev) | |||
2311 | void ipv6_mc_init_dev(struct inet6_dev *idev) | 2312 | void ipv6_mc_init_dev(struct inet6_dev *idev) |
2312 | { | 2313 | { |
2313 | write_lock_bh(&idev->lock); | 2314 | write_lock_bh(&idev->lock); |
2314 | rwlock_init(&idev->mc_lock); | 2315 | spin_lock_init(&idev->mc_lock); |
2315 | idev->mc_gq_running = 0; | 2316 | idev->mc_gq_running = 0; |
2316 | setup_timer(&idev->mc_gq_timer, mld_gq_timer_expire, | 2317 | setup_timer(&idev->mc_gq_timer, mld_gq_timer_expire, |
2317 | (unsigned long)idev); | 2318 | (unsigned long)idev); |