[PATCH][4/4] Add NUMA node handling to the container driver

Keiichiro Tokunaga
2004-09-23T16:36:42Z

Name: container_for_numa.patch
Status: Tested on 2.6.9-rc2
Signed-off-by: Keiichiro Tokunaga <tokunaga.keiich@jp.fujitsu.com>
Description:
Add NUMA node handling to the container driver.

Thanks,
Keiichiro Tokunaga
---

linux-2.6.9-rc2-fix-kei/drivers/acpi/container.c | 11 +++++++++++
linux-2.6.9-rc2-fix-kei/include/acpi/container.h | 15 ++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)

diff -puN drivers/acpi/container.c~container_for_numa drivers/acpi/container.c
--- linux-2.6.9-rc2-fix/drivers/acpi/container.c~container_for_numa 2004-09-24 00:45:56.781826629 +0900
+++ linux-2.6.9-rc2-fix-kei/drivers/acpi/container.c 2004-09-24 01:38:09.774323452 +0900
@@ -104,6 +104,8 @@ acpi_container_add(struct acpi_device *d
container = kmalloc(sizeof(struct acpi_container), GFP_KERNEL);
if(!container)
return_VALUE(-ENOMEM);
+
+ container_numa_init(device->handle);

memset(container, 0, sizeof(struct acpi_container));
container->handle = device->handle;
@@ -123,6 +125,14 @@ acpi_container_remove(struct acpi_device
{
acpi_status status = AE_OK;
struct acpi_container *pc = NULL;
+ if (type = ACPI_BUS_REMOVAL_EJECT) {
+ if (!device->flags.ejectable)
+ return(-EINVAL);
+
+ container_numa_remove(device->handle);
+ }
+
+ container_numa_detach_data(device->handle);
pc = (struct acpi_container*) acpi_driver_data(device);

if (pc)
@@ -198,6 +208,7 @@ container_device_add(struct acpi_device
if (acpi_bus_add(device, pdev, handle, ACPI_BUS_TYPE_DEVICE)) {
return_VALUE(-ENODEV);
}
+ container_numa_add((*device)->handle);

result = acpi_bus_scan(*device);

diff -puN include/acpi/container.h~container_for_numa include/acpi/container.h
--- linux-2.6.9-rc2-fix/include/acpi/container.h~container_for_numa 2004-09-24 00:45:56.783779765 +0900
+++ linux-2.6.9-rc2-fix-kei/include/acpi/container.h 2004-09-24 00:45:56.786709469 +0900
@@ -2,12 +2,25 @@
#define __ACPI_CONTAINER_H

#include <linux/kernel.h>
-
struct acpi_container {
acpi_handle handle;
unsigned long sun;
int state;
};

+#ifdef CONFIG_ACPI_NUMA
+#include <acpi/numa.h>
+#define container_numa_init(handle) acpi_numa_node_init(handle)
+#define container_numa_add(handle) acpi_numa_node_add(handle)
+#define container_numa_remove(handle) acpi_numa_node_remove(handle)
+#define container_numa_detach_data(handle) acpi_numa_node_data_detach(handle)
+#define is_numa_node(handle) is_numa_node_device(acpi_handle handle)
+#else
+#define container_numa_init(handle)
+#define container_numa_add(handle)
+#define container_numa_remove(handle)
+#define container_numa_detach_data(handle)
+#define is_numa_node(handle) (0)
+#endif
#endif /* __ACPI_CONTAINER_H */

_