Skip to content

Commit

Permalink
blk-cgroup: pass a gendisk to blkg_destroy_all
Browse files Browse the repository at this point in the history
Pass the gendisk to blkg_destroy_all as part of moving the blk-cgroup
infrastructure to be gendisk based.

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-16-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Sep 27, 2022
1 parent cad9266 commit 00ad699
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions block/blk-cgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,9 @@ static void blkg_destroy(struct blkcg_gq *blkg)
percpu_ref_kill(&blkg->refcnt);
}

/**
* blkg_destroy_all - destroy all blkgs associated with a request_queue
* @q: request_queue of interest
*
* Destroy all blkgs associated with @q.
*/
static void blkg_destroy_all(struct request_queue *q)
static void blkg_destroy_all(struct gendisk *disk)
{
struct request_queue *q = disk->queue;
struct blkcg_gq *blkg, *n;
int count = BLKG_DESTROY_BATCH_SIZE;

Expand Down Expand Up @@ -1276,7 +1271,7 @@ int blkcg_init_disk(struct gendisk *disk)
err_ioprio_exit:
blk_ioprio_exit(disk);
err_destroy_all:
blkg_destroy_all(q);
blkg_destroy_all(disk);
return ret;
err_unlock:
spin_unlock_irq(&q->queue_lock);
Expand All @@ -1287,7 +1282,7 @@ int blkcg_init_disk(struct gendisk *disk)

void blkcg_exit_disk(struct gendisk *disk)
{
blkg_destroy_all(disk->queue);
blkg_destroy_all(disk);
blk_throtl_exit(disk);
}

Expand Down

0 comments on commit 00ad699

Please sign in to comment.