Commit 62e35f94 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: pass a gendisk to the queue_sysfs_entry methods

The kobject for the queue entries is embedded into a struct gendisk.
Pass it to the sysfs methods instead of the request_queue derived from
it.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240627111407.476276-4-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 319e8cfd
This diff is collapsed.
...@@ -709,24 +709,25 @@ static int elevator_change(struct request_queue *q, const char *elevator_name) ...@@ -709,24 +709,25 @@ static int elevator_change(struct request_queue *q, const char *elevator_name)
return ret; return ret;
} }
ssize_t elv_iosched_store(struct request_queue *q, const char *buf, ssize_t elv_iosched_store(struct gendisk *disk, const char *buf,
size_t count) size_t count)
{ {
char elevator_name[ELV_NAME_MAX]; char elevator_name[ELV_NAME_MAX];
int ret; int ret;
if (!elv_support_iosched(q)) if (!elv_support_iosched(disk->queue))
return count; return count;
strscpy(elevator_name, buf, sizeof(elevator_name)); strscpy(elevator_name, buf, sizeof(elevator_name));
ret = elevator_change(q, strstrip(elevator_name)); ret = elevator_change(disk->queue, strstrip(elevator_name));
if (!ret) if (!ret)
return count; return count;
return ret; return ret;
} }
ssize_t elv_iosched_show(struct request_queue *q, char *name) ssize_t elv_iosched_show(struct gendisk *disk, char *name)
{ {
struct request_queue *q = disk->queue;
struct elevator_queue *eq = q->elevator; struct elevator_queue *eq = q->elevator;
struct elevator_type *cur = NULL, *e; struct elevator_type *cur = NULL, *e;
int len = 0; int len = 0;
......
...@@ -147,8 +147,8 @@ extern void elv_unregister(struct elevator_type *); ...@@ -147,8 +147,8 @@ extern void elv_unregister(struct elevator_type *);
/* /*
* io scheduler sysfs switching * io scheduler sysfs switching
*/ */
extern ssize_t elv_iosched_show(struct request_queue *, char *); ssize_t elv_iosched_show(struct gendisk *disk, char *page);
extern ssize_t elv_iosched_store(struct request_queue *, const char *, size_t); ssize_t elv_iosched_store(struct gendisk *disk, const char *page, size_t count);
extern bool elv_bio_merge_ok(struct request *, struct bio *); extern bool elv_bio_merge_ok(struct request *, struct bio *);
extern struct elevator_queue *elevator_alloc(struct request_queue *, extern struct elevator_queue *elevator_alloc(struct request_queue *,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment