aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/genhd.c
diff options
context:
space:
mode:
authorChristoph Lameter <christoph@lameter.com>2005-06-23 03:08:19 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 12:45:09 -0400
commit1946089a109251655c5438d92c539bd2930e71ea (patch)
tree819a492d5a7c4e6e695b150a86abeb99d5ac46eb /drivers/block/genhd.c
parent8c5a09082f4e61a176382e96a831a0636b918602 (diff)
[PATCH] NUMA aware block device control structure allocation
Patch to allocate the control structures for for ide devices on the node of the device itself (for NUMA systems). The patch depends on the Slab API change patch by Manfred and me (in mm) and the pcidev_to_node patch that I posted today. Does some realignment too. Signed-off-by: Justin M. Forbes <jmforbes@linuxtx.org> Signed-off-by: Christoph Lameter <christoph@lameter.com> Signed-off-by: Pravin Shelar <pravin@calsoftinc.com> Signed-off-by: Shobhit Dayal <shobhit@calsoftinc.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/genhd.c')
-rw-r--r--drivers/block/genhd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/block/genhd.c b/drivers/block/genhd.c
index 53f7d846b747..43805e4d31e9 100644
--- a/drivers/block/genhd.c
+++ b/drivers/block/genhd.c
@@ -582,10 +582,16 @@ struct seq_operations diskstats_op = {
582 .show = diskstats_show 582 .show = diskstats_show
583}; 583};
584 584
585
586struct gendisk *alloc_disk(int minors) 585struct gendisk *alloc_disk(int minors)
587{ 586{
588 struct gendisk *disk = kmalloc(sizeof(struct gendisk), GFP_KERNEL); 587 return alloc_disk_node(minors, -1);
588}
589
590struct gendisk *alloc_disk_node(int minors, int node_id)
591{
592 struct gendisk *disk;
593
594 disk = kmalloc_node(sizeof(struct gendisk), GFP_KERNEL, node_id);
589 if (disk) { 595 if (disk) {
590 memset(disk, 0, sizeof(struct gendisk)); 596 memset(disk, 0, sizeof(struct gendisk));
591 if (!init_disk_stats(disk)) { 597 if (!init_disk_stats(disk)) {
@@ -594,7 +600,7 @@ struct gendisk *alloc_disk(int minors)
594 } 600 }
595 if (minors > 1) { 601 if (minors > 1) {
596 int size = (minors - 1) * sizeof(struct hd_struct *); 602 int size = (minors - 1) * sizeof(struct hd_struct *);
597 disk->part = kmalloc(size, GFP_KERNEL); 603 disk->part = kmalloc_node(size, GFP_KERNEL, node_id);
598 if (!disk->part) { 604 if (!disk->part) {
599 kfree(disk); 605 kfree(disk);
600 return NULL; 606 return NULL;
@@ -610,6 +616,7 @@ struct gendisk *alloc_disk(int minors)
610} 616}
611 617
612EXPORT_SYMBOL(alloc_disk); 618EXPORT_SYMBOL(alloc_disk);
619EXPORT_SYMBOL(alloc_disk_node);
613 620
614struct kobject *get_disk(struct gendisk *disk) 621struct kobject *get_disk(struct gendisk *disk)
615{ 622{