Commit 04be60b5 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

blk-cgroup: consolidate error handling in blkcg_init_queue

Use a goto label to merge two identical pieces of error handling code.
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent b6676f65
...@@ -1173,21 +1173,19 @@ int blkcg_init_queue(struct request_queue *q) ...@@ -1173,21 +1173,19 @@ int blkcg_init_queue(struct request_queue *q)
radix_tree_preload_end(); radix_tree_preload_end();
ret = blk_iolatency_init(q); ret = blk_iolatency_init(q);
if (ret) { if (ret)
spin_lock_irq(q->queue_lock); goto err_destroy_all;
blkg_destroy_all(q);
spin_unlock_irq(q->queue_lock);
return ret;
}
ret = blk_throtl_init(q); ret = blk_throtl_init(q);
if (ret) { if (ret)
spin_lock_irq(q->queue_lock); goto err_destroy_all;
blkg_destroy_all(q); return 0;
spin_unlock_irq(q->queue_lock);
}
return ret;
err_destroy_all:
spin_lock_irq(q->queue_lock);
blkg_destroy_all(q);
spin_unlock_irq(q->queue_lock);
return ret;
err_unlock: err_unlock:
spin_unlock_irq(q->queue_lock); spin_unlock_irq(q->queue_lock);
rcu_read_unlock(); rcu_read_unlock();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment