|
@@ -17,6 +17,14 @@ static void blk_mq_sysfs_release(struct kobject *kobj)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
+static void blk_mq_hw_sysfs_release(struct kobject *kobj)
|
|
|
+{
|
|
|
+ struct blk_mq_hw_ctx *hctx = container_of(kobj, struct blk_mq_hw_ctx,
|
|
|
+ kobj);
|
|
|
+ kfree(hctx->ctxs);
|
|
|
+ kfree(hctx);
|
|
|
+}
|
|
|
+
|
|
|
struct blk_mq_ctx_sysfs_entry {
|
|
|
struct attribute attr;
|
|
|
ssize_t (*show)(struct blk_mq_ctx *, char *);
|
|
@@ -200,7 +208,7 @@ static struct kobj_type blk_mq_ctx_ktype = {
|
|
|
static struct kobj_type blk_mq_hw_ktype = {
|
|
|
.sysfs_ops = &blk_mq_hw_sysfs_ops,
|
|
|
.default_attrs = default_hw_ctx_attrs,
|
|
|
- .release = blk_mq_sysfs_release,
|
|
|
+ .release = blk_mq_hw_sysfs_release,
|
|
|
};
|
|
|
|
|
|
static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
|
|
@@ -244,12 +252,9 @@ static void __blk_mq_unregister_dev(struct device *dev, struct request_queue *q)
|
|
|
struct blk_mq_hw_ctx *hctx;
|
|
|
int i;
|
|
|
|
|
|
- queue_for_each_hw_ctx(q, hctx, i) {
|
|
|
+ queue_for_each_hw_ctx(q, hctx, i)
|
|
|
blk_mq_unregister_hctx(hctx);
|
|
|
|
|
|
- kobject_put(&hctx->kobj);
|
|
|
- }
|
|
|
-
|
|
|
blk_mq_debugfs_unregister_hctxs(q);
|
|
|
|
|
|
kobject_uevent(&q->mq_kobj, KOBJ_REMOVE);
|