Skip to content

Commit 928f6f0

Browse files
Christoph Hellwigaxboe
authored andcommitted
blk-cgroup: remove blk_queue_root_blkg
Just open code it in the only caller and drop the unused !BLK_CGROUP stub. 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/20220921180501.1539876-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 33dc627 commit 928f6f0

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

block/blk-cgroup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -915,8 +915,7 @@ static void blkcg_fill_root_iostats(void)
915915
class_dev_iter_init(&iter, &block_class, NULL, &disk_type);
916916
while ((dev = class_dev_iter_next(&iter))) {
917917
struct block_device *bdev = dev_to_bdev(dev);
918-
struct blkcg_gq *blkg =
919-
blk_queue_root_blkg(bdev_get_queue(bdev));
918+
struct blkcg_gq *blkg = bdev->bd_disk->queue->root_blkg;
920919
struct blkg_iostat tmp;
921920
int cpu;
922921
unsigned long flags;

block/blk-cgroup.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -268,17 +268,6 @@ static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg,
268268
return __blkg_lookup(blkcg, q, false);
269269
}
270270

271-
/**
272-
* blk_queue_root_blkg - return blkg for the (blkcg_root, @q) pair
273-
* @q: request_queue of interest
274-
*
275-
* Lookup blkg for @q at the root level. See also blkg_lookup().
276-
*/
277-
static inline struct blkcg_gq *blk_queue_root_blkg(struct request_queue *q)
278-
{
279-
return q->root_blkg;
280-
}
281-
282271
/**
283272
* blkg_to_pdata - get policy private data
284273
* @blkg: blkg of interest
@@ -507,8 +496,6 @@ struct blkcg {
507496
};
508497

509498
static inline struct blkcg_gq *blkg_lookup(struct blkcg *blkcg, void *key) { return NULL; }
510-
static inline struct blkcg_gq *blk_queue_root_blkg(struct request_queue *q)
511-
{ return NULL; }
512499
static inline int blkcg_init_queue(struct request_queue *q) { return 0; }
513500
static inline void blkcg_exit_queue(struct request_queue *q) { }
514501
static inline int blkcg_policy_register(struct blkcg_policy *pol) { return 0; }

0 commit comments

Comments
 (0)