You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
@@ -59,15 +59,17 @@ noop_latter_request(struct request_queue *q, struct request *rq)
|
||||
return list_entry(rq->queuelist.next, 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;
|
||||
|
||||
INIT_LIST_HEAD(&nd->queue);
|
||||
return nd;
|
||||
q->elevator->elevator_data = nd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void noop_exit_queue(struct elevator_queue *e)
|
||||
|
||||
Reference in New Issue
Block a user