Skip to content

Commit

Permalink
blk-wbt: pass a gendisk to wbt_init
Browse files Browse the repository at this point in the history
Pass a gendisk to wbt_init to prepare for phasing out usage of the
request_queue in the blk-cgroup code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Andreas Herrmann <aherrmann@suse.de>
Acked-by: Tejun Heo <tj@kernel.org>
Link: https://lore.kernel.org/r/20230203150400.3199230-10-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Feb 3, 2023
1 parent 04aad37 commit 958f296
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion block/blk-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page,

rqos = wbt_rq_qos(q);
if (!rqos) {
ret = wbt_init(q);
ret = wbt_init(q->disk);
if (ret)
return ret;
}
Expand Down
5 changes: 3 additions & 2 deletions block/blk-wbt.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void wbt_enable_default(struct gendisk *disk)
return;

if (queue_is_mq(q) && !disable_flag)
wbt_init(q);
wbt_init(disk);
}
EXPORT_SYMBOL_GPL(wbt_enable_default);

Expand Down Expand Up @@ -835,8 +835,9 @@ static struct rq_qos_ops wbt_rqos_ops = {
#endif
};

int wbt_init(struct request_queue *q)
int wbt_init(struct gendisk *disk)
{
struct request_queue *q = disk->queue;
struct rq_wb *rwb;
int i;
int ret;
Expand Down
4 changes: 2 additions & 2 deletions block/blk-wbt.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static inline unsigned int wbt_inflight(struct rq_wb *rwb)

#ifdef CONFIG_BLK_WBT

int wbt_init(struct request_queue *);
int wbt_init(struct gendisk *disk);
void wbt_disable_default(struct gendisk *disk);
void wbt_enable_default(struct gendisk *disk);

Expand All @@ -104,7 +104,7 @@ u64 wbt_default_latency_nsec(struct request_queue *);

#else

static inline int wbt_init(struct request_queue *q)
static inline int wbt_init(struct gendisk *disk)
{
return -EINVAL;
}
Expand Down

0 comments on commit 958f296

Please sign in to comment.