path: root/block/noop-iosched.c
diff options
authorTejun Heo <>2012-03-05 13:14:57 -0800
committerJens Axboe <>2012-03-06 21:27:21 +0100
commitb2fab5acd28ead6f0dd6c3996ba23f0ef1772f15 (patch)
treeb0b96984e1a4d9c856edc9ddfc36e427951c5a86 /block/noop-iosched.c
parent5a5bafdc396b1da7570f84fb96a0f8a288970c5e (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 <> Cc: Vivek Goyal <> Signed-off-by: Jens Axboe <>
Diffstat (limited to 'block/noop-iosched.c')
1 files changed, 5 insertions, 3 deletions
diff --git a/block/noop-iosched.c b/block/noop-iosched.c
index 413a0b1..5d1bf70 100644
--- a/block/noop-iosched.c
+++ b/block/noop-iosched.c
@@ -59,15 +59,17 @@ noop_latter_request(struct request_queue *q, struct request *rq)
return list_entry(rq->, struct request, queuelist);
-static void *noop_init_queue(struct request_queue *q)
+static int noop_init_queue(struct request_queue *q)
struct noop_data *nd;
nd = kmalloc_node(sizeof(*nd), GFP_KERNEL, q->node);
if (!nd)
- return NULL;
+ return -ENOMEM;
- return nd;
+ q->elevator->elevator_data = nd;
+ return 0;
static void noop_exit_queue(struct elevator_queue *e)