[openib-general] [PATCH] gen2/roland compile fixes for 2.6.9-rc1
Tom Duffy
tduffy at sun.com
Tue Aug 24 11:05:19 PDT 2004
This patch updates the locking mechanism introduced in 2.6.9-rc1. I
modeled the fixes based off of changes that went it across the kernel in
that update. Please look over for correctness before applying.
Signed-off-by: Tom Duffy <tduffy at sun.com> with permission from Sun
legal.
Index: drivers/infiniband/core/mad_static.c
===================================================================
--- drivers/infiniband/core/mad_static.c (revision 678)
+++ drivers/infiniband/core/mad_static.c (working copy)
@@ -53,16 +53,15 @@
continue;
}
- idev = in_dev_get(dev);
- if (!idev) {
+ rcu_read_lock();
+ idev = __in_dev_get(dev);
+ if (idev == NULL) {
+ rcu_read_unlock();
continue;
}
- read_lock(&idev->lock);
-
- if (!idev->ifa_list) {
- read_unlock(&idev->lock);
- in_dev_put(idev);
+ if (idev->ifa_list == NULL) {
+ rcu_read_unlock();
continue;
}
@@ -86,8 +85,7 @@
dev->name, i[0], i[1], i[2], i[3], lid_base);
}
- read_unlock(&idev->lock);
- in_dev_put(idev);
+ rcu_read_unlock();
break;
}
read_unlock(&dev_base_lock);
Index: drivers/infiniband/ulp/ipoib/ipoib_multicast.c
===================================================================
--- drivers/infiniband/ulp/ipoib/ipoib_multicast.c (revision 678)
+++ drivers/infiniband/ulp/ipoib/ipoib_multicast.c (working copy)
@@ -961,7 +961,7 @@
list_for_each_entry(mcast, &priv->multicast_list, list)
clear_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags);
- read_lock(&in_dev->lock);
+ read_lock(&in_dev->mc_list_lock);
/* Mark all of the entries that are found or don't exist */
for (im = in_dev->mc_list; im; im = im->next) {
@@ -1026,7 +1026,7 @@
}
}
- read_unlock(&in_dev->lock);
+ read_unlock(&in_dev->mc_list_lock);
/* Remove all of the entries don't exist anymore */
list_for_each_entry_safe(mcast, tmcast, &priv->multicast_list, list) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20040824/2c8ede1a/attachment.sig>
More information about the general
mailing list