aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-07-19 17:39:40 -0400
committerJens Axboe <axboe@nelson.home.kernel.dk>2006-09-30 14:29:39 -0400
commitb5deef901282628d88c784f4c9d2f0583ec3b355 (patch)
tree1d3be92f18c9afd9426b06739c8f76931acbf03f /block/elevator.c
parenta3b05e8f58c95dfccbf2c824d0c68e5990571f24 (diff)
[PATCH] Make sure all block/io scheduler setups are node aware
Some were kmalloc_node(), some were still kmalloc(). Change them all to kmalloc_node(). Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 788d2d81994c..e643291793a4 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -161,12 +161,12 @@ __setup("elevator=", elevator_setup);
161 161
162static struct kobj_type elv_ktype; 162static struct kobj_type elv_ktype;
163 163
164static elevator_t *elevator_alloc(struct elevator_type *e) 164static elevator_t *elevator_alloc(request_queue_t *q, struct elevator_type *e)
165{ 165{
166 elevator_t *eq; 166 elevator_t *eq;
167 int i; 167 int i;
168 168
169 eq = kmalloc(sizeof(elevator_t), GFP_KERNEL); 169 eq = kmalloc_node(sizeof(elevator_t), GFP_KERNEL, q->node);
170 if (unlikely(!eq)) 170 if (unlikely(!eq))
171 goto err; 171 goto err;
172 172
@@ -178,7 +178,8 @@ static elevator_t *elevator_alloc(struct elevator_type *e)
178 eq->kobj.ktype = &elv_ktype; 178 eq->kobj.ktype = &elv_ktype;
179 mutex_init(&eq->sysfs_lock); 179 mutex_init(&eq->sysfs_lock);
180 180
181 eq->hash = kmalloc(sizeof(struct hlist_head) * ELV_HASH_ENTRIES, GFP_KERNEL); 181 eq->hash = kmalloc_node(sizeof(struct hlist_head) * ELV_HASH_ENTRIES,
182 GFP_KERNEL, q->node);
182 if (!eq->hash) 183 if (!eq->hash)
183 goto err; 184 goto err;
184 185
@@ -224,7 +225,7 @@ int elevator_init(request_queue_t *q, char *name)
224 e = elevator_get("noop"); 225 e = elevator_get("noop");
225 } 226 }
226 227
227 eq = elevator_alloc(e); 228 eq = elevator_alloc(q, e);
228 if (!eq) 229 if (!eq)
229 return -ENOMEM; 230 return -ENOMEM;
230 231
@@ -987,7 +988,7 @@ static int elevator_switch(request_queue_t *q, struct elevator_type *new_e)
987 /* 988 /*
988 * Allocate new elevator 989 * Allocate new elevator
989 */ 990 */
990 e = elevator_alloc(new_e); 991 e = elevator_alloc(q, new_e);
991 if (!e) 992 if (!e)
992 return 0; 993 return 0;
993 994