summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/lcs.c
diff options
context:
space:
mode:
authorSachin Sant <sachinp@in.ibm.com>2010-11-26 02:41:17 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-28 18:13:16 -0800
commitf3aa3136d9c15ff693198eb34701a74bb0b6b969 (patch)
tree47f26d5a3ee93d8139e6f4b6b336399dbd585d9b /drivers/s390/net/lcs.c
parent5e9559689735f760f3a1fb9b2aafeb4d8efbf8f5 (diff)
downloadlinux-f3aa3136d9c15ff693198eb34701a74bb0b6b969.tar.gz
linux-f3aa3136d9c15ff693198eb34701a74bb0b6b969.tar.bz2
linux-f3aa3136d9c15ff693198eb34701a74bb0b6b969.zip
qeth lcs: convert mc rwlock to RCU
Commit 1d7138de878d1d4210727c1200193e69596f93b3 igmp: RCU conversion of in_dev->mc_list converted rwlock to RCU. Update the s390 network drivers(qeth & lcs) code to adapt to this change. V2 : Changes based on suggestions given by Eric Dumazet Signed-off-by: Sachin Sant <sachinp@in.ibm.com> Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/lcs.c')
-rw-r--r--drivers/s390/net/lcs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c
index 0f19d540b655..c9f13b9ea339 100644
--- a/drivers/s390/net/lcs.c
+++ b/drivers/s390/net/lcs.c
@@ -1188,7 +1188,8 @@ lcs_remove_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
spin_lock_irqsave(&card->ipm_lock, flags);
list_for_each(l, &card->ipm_list) {
ipm = list_entry(l, struct lcs_ipm_list, list);
- for (im4 = in4_dev->mc_list; im4 != NULL; im4 = im4->next) {
+ for (im4 = rcu_dereference(in4_dev->mc_list);
+ im4 != NULL; im4 = rcu_dereference(im4->next_rcu)) {
lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
if ( (ipm->ipm.ip_addr == im4->multiaddr) &&
(memcmp(buf, &ipm->ipm.mac_addr,
@@ -1233,7 +1234,8 @@ lcs_set_mc_addresses(struct lcs_card *card, struct in_device *in4_dev)
unsigned long flags;
LCS_DBF_TEXT(4, trace, "setmclst");
- for (im4 = in4_dev->mc_list; im4; im4 = im4->next) {
+ for (im4 = rcu_dereference(in4_dev->mc_list); im4 != NULL;
+ im4 = rcu_dereference(im4->next_rcu)) {
lcs_get_mac_for_ipm(im4->multiaddr, buf, card->dev);
ipm = lcs_check_addr_entry(card, im4, buf);
if (ipm != NULL)
@@ -1269,10 +1271,10 @@ lcs_register_mc_addresses(void *data)
in4_dev = in_dev_get(card->dev);
if (in4_dev == NULL)
goto out;
- read_lock(&in4_dev->mc_list_lock);
+ rcu_read_lock();
lcs_remove_mc_addresses(card,in4_dev);
lcs_set_mc_addresses(card, in4_dev);
- read_unlock(&in4_dev->mc_list_lock);
+ rcu_read_unlock();
in_dev_put(in4_dev);
netif_carrier_off(card->dev);