[openib-general] RE: [PATCH] add node_guid to struct ib_device

Sean Hefty sean.hefty at intel.com
Fri Oct 28 10:30:38 PDT 2005


>Thanks, I applied the following version (doesn't add a private kzalloc()
>now that 2.6.14 is out and doesn't rename cap_mask_mutex).

Thanks.  I forgot to include the changes to sysfs.c in my previous patch.
Not sure if we want to wait on this until the other drivers have been updated.
We'll probably want to remove node_guid from the device attributes as well.

Signed-off-by: Sean Hefty <sean.hefty at intel.com>


Index: sysfs.c
===================================================================
--- sysfs.c	(revision 3892)
+++ sysfs.c	(working copy)
@@ -622,21 +622,15 @@
 static ssize_t show_node_guid(struct class_device *cdev, char *buf)
 {
 	struct ib_device *dev = container_of(cdev, struct ib_device, class_dev);
-	struct ib_device_attr attr;
-	ssize_t ret;
 
 	if (!ibdev_is_alive(dev))
 		return -ENODEV;
 
-	ret = ib_query_device(dev, &attr);
-	if (ret)
-		return ret;
-
 	return sprintf(buf, "%04x:%04x:%04x:%04x\n",
-		       be16_to_cpu(((__be16 *) &attr.node_guid)[0]),
-		       be16_to_cpu(((__be16 *) &attr.node_guid)[1]),
-		       be16_to_cpu(((__be16 *) &attr.node_guid)[2]),
-		       be16_to_cpu(((__be16 *) &attr.node_guid)[3]));
+		       be16_to_cpu(((__be16 *) &dev->node_guid)[0]),
+		       be16_to_cpu(((__be16 *) &dev->node_guid)[1]),
+		       be16_to_cpu(((__be16 *) &dev->node_guid)[2]),
+		       be16_to_cpu(((__be16 *) &dev->node_guid)[3]));
 }
 
 static CLASS_DEVICE_ATTR(node_type, S_IRUGO, show_node_type, NULL);






More information about the general mailing list