|
@@ -15,26 +15,6 @@
|
|
|
|
|
|
static void blk_mq_sysfs_release(struct kobject *kobj)
|
|
static void blk_mq_sysfs_release(struct kobject *kobj)
|
|
{
|
|
{
|
|
- struct request_queue *q;
|
|
|
|
-
|
|
|
|
- q = container_of(kobj, struct request_queue, mq_kobj);
|
|
|
|
- free_percpu(q->queue_ctx);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void blk_mq_ctx_release(struct kobject *kobj)
|
|
|
|
-{
|
|
|
|
- struct blk_mq_ctx *ctx;
|
|
|
|
-
|
|
|
|
- ctx = container_of(kobj, struct blk_mq_ctx, kobj);
|
|
|
|
- kobject_put(&ctx->queue->mq_kobj);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void blk_mq_hctx_release(struct kobject *kobj)
|
|
|
|
-{
|
|
|
|
- struct blk_mq_hw_ctx *hctx;
|
|
|
|
-
|
|
|
|
- hctx = container_of(kobj, struct blk_mq_hw_ctx, kobj);
|
|
|
|
- kfree(hctx);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
struct blk_mq_ctx_sysfs_entry {
|
|
struct blk_mq_ctx_sysfs_entry {
|
|
@@ -338,13 +318,13 @@ static struct kobj_type blk_mq_ktype = {
|
|
static struct kobj_type blk_mq_ctx_ktype = {
|
|
static struct kobj_type blk_mq_ctx_ktype = {
|
|
.sysfs_ops = &blk_mq_sysfs_ops,
|
|
.sysfs_ops = &blk_mq_sysfs_ops,
|
|
.default_attrs = default_ctx_attrs,
|
|
.default_attrs = default_ctx_attrs,
|
|
- .release = blk_mq_ctx_release,
|
|
|
|
|
|
+ .release = blk_mq_sysfs_release,
|
|
};
|
|
};
|
|
|
|
|
|
static struct kobj_type blk_mq_hw_ktype = {
|
|
static struct kobj_type blk_mq_hw_ktype = {
|
|
.sysfs_ops = &blk_mq_hw_sysfs_ops,
|
|
.sysfs_ops = &blk_mq_hw_sysfs_ops,
|
|
.default_attrs = default_hw_ctx_attrs,
|
|
.default_attrs = default_hw_ctx_attrs,
|
|
- .release = blk_mq_hctx_release,
|
|
|
|
|
|
+ .release = blk_mq_sysfs_release,
|
|
};
|
|
};
|
|
|
|
|
|
static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
|
|
static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx)
|
|
@@ -375,7 +355,6 @@ static int blk_mq_register_hctx(struct blk_mq_hw_ctx *hctx)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
hctx_for_each_ctx(hctx, ctx, i) {
|
|
hctx_for_each_ctx(hctx, ctx, i) {
|
|
- kobject_get(&q->mq_kobj);
|
|
|
|
ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu);
|
|
ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu);
|
|
if (ret)
|
|
if (ret)
|
|
break;
|
|
break;
|