blk-mq: make lifetime consistent between hctx and its kobject
authorMing Lei <tom.leiming@gmail.com>
Wed, 22 Feb 2017 10:14:01 +0000 (18:14 +0800)
committerJens Axboe <axboe@fb.com>
Wed, 8 Mar 2017 16:56:12 +0000 (09:56 -0700)
commit6c8b232efea1ad3d263ff8b9c16b7e8767a77488
treedb30d630a2a170b7f67479654da43812c1d674fa
parent7ea5fe31c12dd8bcf4a9c5a4a7e8e23826a9a3b8
blk-mq: make lifetime consistent between hctx and its kobject

This patch removes kobject_put() over hctx in __blk_mq_unregister_dev(),
and trys to keep lifetime consistent between hctx and hctx's kobject.

Now blk_mq_sysfs_register() and blk_mq_sysfs_unregister() become
totally symmetrical, and kobject's refcounter drops to zero just
when the hctx is freed.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Tested-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-mq-sysfs.c
block/blk-mq.c