summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorBrice Goglin <Brice.Goglin@ens-lyon.org>2007-01-28 10:53:40 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2007-02-16 15:30:11 -0800
commit81bb0e198b4638ac65233b316f4588639dfe1fcd (patch)
tree3617a2de9a6ace551979ce99a5e3857f4a123ff7 /drivers/pci/pci-sysfs.c
parentf52383d395178afde66d049e176bb2c59a8c941a (diff)
downloadop-kernel-dev-81bb0e198b4638ac65233b316f4588639dfe1fcd.zip
op-kernel-dev-81bb0e198b4638ac65233b316f4588639dfe1fcd.tar.gz
PCI: Make PCI device numa-node attribute visible in sysfs
Export the numa-node attribute of PCI devices in sysfs so that user applications may choose where to be placed accordingly. Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 7a94076..cd913a2 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -143,6 +143,14 @@ static ssize_t is_enabled_show(struct device *dev,
return sprintf (buf, "%u\n", atomic_read(&pdev->enable_cnt));
}
+#ifdef CONFIG_NUMA
+static ssize_t
+numa_node_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ return sprintf (buf, "%d\n", dev->numa_node);
+}
+#endif
+
static ssize_t
msi_bus_show(struct device *dev, struct device_attribute *attr, char *buf)
{
@@ -194,6 +202,9 @@ struct device_attribute pci_dev_attrs[] = {
__ATTR_RO(irq),
__ATTR_RO(local_cpus),
__ATTR_RO(modalias),
+#ifdef CONFIG_NUMA
+ __ATTR_RO(numa_node),
+#endif
__ATTR(enable, 0600, is_enabled_show, is_enabled_store),
__ATTR(broken_parity_status,(S_IRUGO|S_IWUSR),
broken_parity_status_show,broken_parity_status_store),
OpenPOWER on IntegriCloud