All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Damien.LeMoal@wdc.com, axboe@kernel.dk, linux-block@vger.kernel.org
Cc: bgurney@redhat.com, Jeff Moyer <jmoyer@redhat.com>
Subject: [PATCH 1/2] block: __elevator_change: add try_loading parameter
Date: Fri, 25 May 2018 17:14:31 -0400	[thread overview]
Message-ID: <20180525211432.20359-2-jmoyer@redhat.com> (raw)
In-Reply-To: <20180525211432.20359-1-jmoyer@redhat.com>

The next patch will add a caller that can't trigger module loads.
Also export this function for that caller.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
---
 block/blk.h      | 2 ++
 block/elevator.c | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/block/blk.h b/block/blk.h
index b034fd2..f6c3cc1 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -233,6 +233,8 @@ static inline void elv_deactivate_rq(struct request_queue *q, struct request *rq
 
 int elv_register_queue(struct request_queue *q);
 void elv_unregister_queue(struct request_queue *q);
+int __elevator_change(struct request_queue *q, const char *name,
+		      bool try_loading);
 
 struct hd_struct *__disk_get_part(struct gendisk *disk, int partno);
 
diff --git a/block/elevator.c b/block/elevator.c
index e87e9b4..5a91a43 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -1075,7 +1075,8 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
 /*
  * Switch this queue to the given IO scheduler.
  */
-static int __elevator_change(struct request_queue *q, const char *name)
+int __elevator_change(struct request_queue *q, const char *name,
+		      bool try_loading)
 {
 	char elevator_name[ELV_NAME_MAX];
 	struct elevator_type *e;
@@ -1091,7 +1092,7 @@ static int __elevator_change(struct request_queue *q, const char *name)
 		return elevator_switch(q, NULL);
 
 	strlcpy(elevator_name, name, sizeof(elevator_name));
-	e = elevator_get(q, strstrip(elevator_name), true);
+	e = elevator_get(q, strstrip(elevator_name), try_loading);
 	if (!e)
 		return -EINVAL;
 
@@ -1119,7 +1120,7 @@ ssize_t elv_iosched_store(struct request_queue *q, const char *name,
 	if (!(q->mq_ops || q->request_fn) || !elv_support_iosched(q))
 		return count;
 
-	ret = __elevator_change(q, name);
+	ret = __elevator_change(q, name, true);
 	if (!ret)
 		return count;
 
-- 
2.8.2.335.g4bb51ae

  reply	other threads:[~2018-05-25 21:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 21:14 [PATCH 0/2][RFC] block: default to deadline for SMR devices Jeff Moyer
2018-05-25 21:14 ` Jeff Moyer [this message]
2018-05-25 21:14 ` [PATCH 2/2] block: default to deadline for host-managed " Jeff Moyer
2018-05-25 22:04 ` [PATCH 0/2][RFC] block: default to deadline for " Jens Axboe
2018-05-25 22:18   ` Jeff Moyer
2018-05-26  4:01     ` Jens Axboe
2018-05-29 12:14       ` Bryan Gurney
2018-05-30  6:22       ` Damien Le Moal
2018-05-30  8:47         ` Christoph Hellwig
2018-05-31  5:36           ` Damien Le Moal
2018-05-30 13:45         ` Bryan Gurney
2018-05-30  8:49       ` Christoph Hellwig
2018-05-30 14:22         ` Jens Axboe
2018-05-30 15:06           ` Jeff Moyer
2018-05-30 15:17             ` Jens Axboe
2018-05-30 15:45               ` Jeff Moyer
2018-05-30 15:52                 ` Jens Axboe
2018-05-31  3:16                   ` Damien Le Moal
2018-05-31  3:04                 ` Damien Le Moal

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=20180525211432.20359-2-jmoyer@redhat.com \
    --to=jmoyer@redhat.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=axboe@kernel.dk \
    --cc=bgurney@redhat.com \
    --cc=linux-block@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.