From: Alexey Klimov <klimov.linux@gmail.com>
To: axboe@kernel.dk, linux-block@vger.kernel.org, axboe@fb.com
Cc: jmoyer@redhat.com, linux-kernel@vger.kernel.org,
yury.norov@gmail.com, Alexey Klimov <klimov.linux@gmail.com>
Subject: [PATCH RESEND] elevator: remove second argument in elevator_init()
Date: Tue, 11 Oct 2016 01:32:49 +0100 [thread overview]
Message-ID: <20161011003249.5010-1-klimov.linux@gmail.com> (raw)
Last user of elevator_init() with non-NULL name as second argument
that supposed to be s390 dasd driver has gone few releases ago.
Drivers rely on elevator_change(), elevator_switch() and friends
for example. Right now elevator_init() is always called as
elevator_init(q, NULL).
Patch removes passing of second name argument and its usage.
While we're at it fix following if-check after removed lines. We know
that elevator_type e is initialized by NULL and need to check only
chosen_elevator.
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Reviewed-by: Jeff Moyer <jmoyer@redhat.com>
---
block/blk-core.c | 2 +-
block/elevator.c | 10 ++--------
include/linux/elevator.h | 2 +-
3 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 36c7ac3..6e36d0b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -871,7 +871,7 @@ blk_init_allocated_queue(struct request_queue *q, request_fn_proc *rfn,
mutex_lock(&q->sysfs_lock);
/* init elevator */
- if (elevator_init(q, NULL)) {
+ if (elevator_init(q)) {
mutex_unlock(&q->sysfs_lock);
goto fail;
}
diff --git a/block/elevator.c b/block/elevator.c
index f7d973a..e810938 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -177,7 +177,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;
@@ -196,18 +196,12 @@ int elevator_init(struct request_queue *q, char *name)
q->end_sector = 0;
q->boundary_rq = NULL;
- if (name) {
- e = elevator_get(name, true);
- if (!e)
- return -EINVAL;
- }
-
/*
* Use the default elevator specified by config boot param or
* 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 && *chosen_elevator) {
+ if (*chosen_elevator) {
e = elevator_get(chosen_elevator, false);
if (!e)
printk(KERN_ERR "I/O scheduler %s not found\n",
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index e7f358d..ab6963e 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -159,7 +159,7 @@ extern void elv_unregister(struct elevator_type *);
extern ssize_t elv_iosched_show(struct request_queue *, char *);
extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t);
-extern int elevator_init(struct request_queue *, char *);
+extern int elevator_init(struct request_queue *);
extern void elevator_exit(struct elevator_queue *);
extern int elevator_change(struct request_queue *, const char *);
extern bool elv_bio_merge_ok(struct request *, struct bio *);
--
2.9.3
reply other threads:[~2016-10-11 0:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161011003249.5010-1-klimov.linux@gmail.com \
--to=klimov.linux@gmail.com \
--cc=axboe@fb.com \
--cc=axboe@kernel.dk \
--cc=jmoyer@redhat.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome