Skip to content

Commit

Permalink
block: remove the always unused name argument to elevator_init
Browse files Browse the repository at this point in the history
Reported-by: Damien Le Moal <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Damien Le Moal <[email protected]>
Tested-by: Damien Le Moal <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Jun 1, 2018
1 parent a8a275c commit ddb7253
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ int blk_init_allocated_queue(struct request_queue *q)
mutex_lock(&q->sysfs_lock);

/* init elevator */
if (elevator_init(q, NULL)) {
if (elevator_init(q)) {
mutex_unlock(&q->sysfs_lock);
goto out_exit_flush_rq;
}
Expand Down
2 changes: 1 addition & 1 deletion block/blk-mq-sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ int blk_mq_sched_init(struct request_queue *q)
int ret;

mutex_lock(&q->sysfs_lock);
ret = elevator_init(q, NULL);
ret = elevator_init(q);
mutex_unlock(&q->sysfs_lock);

return ret;
Expand Down
2 changes: 1 addition & 1 deletion block/blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ static inline void elv_deactivate_rq(struct request_queue *q, struct request *rq
e->type->ops.sq.elevator_deactivate_req_fn(q, rq);
}

int elevator_init(struct request_queue *, char *);
int elevator_init(struct request_queue *);
void elevator_exit(struct request_queue *, struct elevator_queue *);
int elv_register_queue(struct request_queue *q);
void elv_unregister_queue(struct request_queue *q);
Expand Down
10 changes: 2 additions & 8 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ static void elevator_release(struct kobject *kobj)
kfree(e);
}

int elevator_init(struct request_queue *q, char *name)
int elevator_init(struct request_queue *q)
{
struct elevator_type *e = NULL;
int err;
Expand All @@ -213,19 +213,13 @@ int elevator_init(struct request_queue *q, char *name)
if (unlikely(q->elevator))
return 0;

if (name) {
e = elevator_get(q, name, true);
if (!e)
return -EINVAL;
}

/*
* Use the default elevator specified by config boot param for
* non-mq devices, or by config option. Don't try to load modules
* as we could be running off async and request_module() isn't
* allowed from async.
*/
if (!e && !q->mq_ops && *chosen_elevator) {
if (!q->mq_ops && *chosen_elevator) {
e = elevator_get(q, chosen_elevator, false);
if (!e)
printk(KERN_ERR "I/O scheduler %s not found\n",
Expand Down

0 comments on commit ddb7253

Please sign in to comment.