diff options
author | Tejun Heo <tj@kernel.org> | 2012-03-05 16:14:57 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-03-06 15:27:21 -0500 |
commit | b2fab5acd28ead6f0dd6c3996ba23f0ef1772f15 (patch) | |
tree | b0b96984e1a4d9c856edc9ddfc36e427951c5a86 /block/deadline-iosched.c | |
parent | 5a5bafdc396b1da7570f84fb96a0f8a288970c5e (diff) |
elevator: make elevator_init_fn() return 0/-errno
elevator_ops->elevator_init_fn() has a weird return value. It returns
a void * which the caller should assign to q->elevator->elevator_data
and %NULL return denotes init failure.
Update such that it returns integer 0/-errno and sets elevator_data
directly as necessary.
This makes the interface more conventional and eases further cleanup.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/deadline-iosched.c')
-rw-r--r-- | block/deadline-iosched.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 7bf12d793fcd..599b12e5380f 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -337,13 +337,13 @@ static void deadline_exit_queue(struct elevator_queue *e) | |||
337 | /* | 337 | /* |
338 | * initialize elevator private data (deadline_data). | 338 | * initialize elevator private data (deadline_data). |
339 | */ | 339 | */ |
340 | static void *deadline_init_queue(struct request_queue *q) | 340 | static int deadline_init_queue(struct request_queue *q) |
341 | { | 341 | { |
342 | struct deadline_data *dd; | 342 | struct deadline_data *dd; |
343 | 343 | ||
344 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL | __GFP_ZERO, q->node); | 344 | dd = kmalloc_node(sizeof(*dd), GFP_KERNEL | __GFP_ZERO, q->node); |
345 | if (!dd) | 345 | if (!dd) |
346 | return NULL; | 346 | return -ENOMEM; |
347 | 347 | ||
348 | INIT_LIST_HEAD(&dd->fifo_list[READ]); | 348 | INIT_LIST_HEAD(&dd->fifo_list[READ]); |
349 | INIT_LIST_HEAD(&dd->fifo_list[WRITE]); | 349 | INIT_LIST_HEAD(&dd->fifo_list[WRITE]); |
@@ -354,7 +354,9 @@ static void *deadline_init_queue(struct request_queue *q) | |||
354 | dd->writes_starved = writes_starved; | 354 | dd->writes_starved = writes_starved; |
355 | dd->front_merges = 1; | 355 | dd->front_merges = 1; |
356 | dd->fifo_batch = fifo_batch; | 356 | dd->fifo_batch = fifo_batch; |
357 | return dd; | 357 | |
358 | q->elevator->elevator_data = dd; | ||
359 | return 0; | ||
358 | } | 360 | } |
359 | 361 | ||
360 | /* | 362 | /* |