ide: NUMA aware allocation of host and port structures

kzalloc() -> kzalloc_node() in ide_host_alloc().
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 07af5a5b
...@@ -1391,9 +1391,11 @@ static void ide_free_port_slot(int idx) ...@@ -1391,9 +1391,11 @@ static void ide_free_port_slot(int idx)
struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws) struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
{ {
struct ide_host *host; struct ide_host *host;
struct device *dev = hws[0] ? hws[0]->dev : NULL;
int node = dev ? dev_to_node(dev) : -1;
int i; int i;
host = kzalloc(sizeof(*host), GFP_KERNEL); host = kzalloc_node(sizeof(*host), GFP_KERNEL, node);
if (host == NULL) if (host == NULL)
return NULL; return NULL;
...@@ -1404,7 +1406,7 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws) ...@@ -1404,7 +1406,7 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
if (hws[i] == NULL) if (hws[i] == NULL)
continue; continue;
hwif = kzalloc(sizeof(*hwif), GFP_KERNEL); hwif = kzalloc_node(sizeof(*hwif), GFP_KERNEL, node);
if (hwif == NULL) if (hwif == NULL)
continue; continue;
...@@ -1429,8 +1431,7 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws) ...@@ -1429,8 +1431,7 @@ struct ide_host *ide_host_alloc(const struct ide_port_info *d, hw_regs_t **hws)
return NULL; return NULL;
} }
if (hws[0]) host->dev[0] = dev;
host->dev[0] = hws[0]->dev;
if (d) { if (d) {
host->init_chipset = d->init_chipset; host->init_chipset = d->init_chipset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment