diff options
author | Christoph Hellwig <hch@lst.de> | 2018-11-14 11:02:13 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-15 14:13:28 -0500 |
commit | 7fb1763de6f8b4d6e7a69a08a14ce5496500f2c5 (patch) | |
tree | d737fc9458fdd9714e0e37b15d8077dbccde4b13 /block/blk-cgroup.c | |
parent | 04be60b5e4e03fd3d58f7f25b782240a45272fb0 (diff) |
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.c | 9 |
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) | |||
349 | { | 349 | { |
350 | struct blkcg_gq *blkg, *n; | 350 | struct blkcg_gq *blkg, *n; |
351 | 351 | ||
352 | lockdep_assert_held(q->queue_lock); | 352 | spin_lock_irq(q->queue_lock); |
353 | |||
354 | list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) { | 353 | list_for_each_entry_safe(blkg, n, &q->blkg_list, q_node) { |
355 | struct blkcg *blkcg = blkg->blkcg; | 354 | struct blkcg *blkcg = blkg->blkcg; |
356 | 355 | ||
@@ -360,6 +359,7 @@ static void blkg_destroy_all(struct request_queue *q) | |||
360 | } | 359 | } |
361 | 360 | ||
362 | q->root_blkg = NULL; | 361 | q->root_blkg = NULL; |
362 | spin_unlock_irq(q->queue_lock); | ||
363 | } | 363 | } |
364 | 364 | ||
365 | /* | 365 | /* |
@@ -1182,9 +1182,7 @@ int blkcg_init_queue(struct request_queue *q) | |||
1182 | return 0; | 1182 | return 0; |
1183 | 1183 | ||
1184 | err_destroy_all: | 1184 | err_destroy_all: |
1185 | spin_lock_irq(q->queue_lock); | ||
1186 | blkg_destroy_all(q); | 1185 | blkg_destroy_all(q); |
1187 | spin_unlock_irq(q->queue_lock); | ||
1188 | return ret; | 1186 | return ret; |
1189 | err_unlock: | 1187 | err_unlock: |
1190 | spin_unlock_irq(q->queue_lock); | 1188 | spin_unlock_irq(q->queue_lock); |
@@ -1222,10 +1220,7 @@ void blkcg_drain_queue(struct request_queue *q) | |||
1222 | */ | 1220 | */ |
1223 | void blkcg_exit_queue(struct request_queue *q) | 1221 | void blkcg_exit_queue(struct request_queue *q) |
1224 | { | 1222 | { |
1225 | spin_lock_irq(q->queue_lock); | ||
1226 | blkg_destroy_all(q); | 1223 | blkg_destroy_all(q); |
1227 | spin_unlock_irq(q->queue_lock); | ||
1228 | |||
1229 | blk_throtl_exit(q); | 1224 | blk_throtl_exit(q); |
1230 | } | 1225 | } |
1231 | 1226 | ||