summaryrefslogtreecommitdiff
path: root/block/blk-cgroup.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-11-14 19:02:13 +0300
committerJens Axboe <axboe@kernel.dk>2018-11-15 22:13:28 +0300
commit7fb1763de6f8b4d6e7a69a08a14ce5496500f2c5 (patch)
treed737fc9458fdd9714e0e37b15d8077dbccde4b13 /block/blk-cgroup.c
parent04be60b5e4e03fd3d58f7f25b782240a45272fb0 (diff)
downloadlinux-7fb1763de6f8b4d6e7a69a08a14ce5496500f2c5.tar.xz
blk-cgroup: move locking into blkg_destroy_all
Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-cgroup.c')
-rw-r--r--block/blk-cgroup.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 717ab38a6c67..3ba23b9bfeb9 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -349,8 +349,7 @@ static void blkg_destroy_all(struct request_queue *q)
{
struct blkcg_gq *blkg, *n;
- lockdep_assert_held(q->queue_lock);
-
+ spin_lock_irq(q->queue_lock);
list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) {
struct blkcg *blkcg = blkg->blkcg;
@@ -360,6 +359,7 @@ static void blkg_destroy_all(struct request_queue *q)
}
q->root_blkg = NULL;
+ spin_unlock_irq(q->queue_lock);
}
/*
@@ -1182,9 +1182,7 @@ int blkcg_init_queue(struct request_queue *q)
return 0;
err_destroy_all:
- spin_lock_irq(q->queue_lock);
blkg_destroy_all(q);
- spin_unlock_irq(q->queue_lock);
return ret;
err_unlock:
spin_unlock_irq(q->queue_lock);
@@ -1222,10 +1220,7 @@ void blkcg_drain_queue(struct request_queue *q)
*/
void blkcg_exit_queue(struct request_queue *q)
{
- spin_lock_irq(q->queue_lock);
blkg_destroy_all(q);
- spin_unlock_irq(q->queue_lock);
-
blk_throtl_exit(q);
}