diff options
Diffstat (limited to 'block/blk-mq-sysfs.c')
| -rw-r--r-- | block/blk-mq-sysfs.c | 25 |
1 files changed, 2 insertions, 23 deletions
diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index 6774a0e69867..1630a20d5dcf 100644 --- a/block/blk-mq-sysfs.c +++ b/block/blk-mq-sysfs.c | |||
| @@ -15,26 +15,6 @@ | |||
| 15 | 15 | ||
| 16 | static void blk_mq_sysfs_release(struct kobject *kobj) | 16 | static void blk_mq_sysfs_release(struct kobject *kobj) |
| 17 | { | 17 | { |
| 18 | struct request_queue *q; | ||
| 19 | |||
| 20 | q = container_of(kobj, struct request_queue, mq_kobj); | ||
| 21 | free_percpu(q->queue_ctx); | ||
| 22 | } | ||
| 23 | |||
| 24 | static void blk_mq_ctx_release(struct kobject *kobj) | ||
| 25 | { | ||
| 26 | struct blk_mq_ctx *ctx; | ||
| 27 | |||
| 28 | ctx = container_of(kobj, struct blk_mq_ctx, kobj); | ||
| 29 | kobject_put(&ctx->queue->mq_kobj); | ||
| 30 | } | ||
| 31 | |||
| 32 | static void blk_mq_hctx_release(struct kobject *kobj) | ||
| 33 | { | ||
| 34 | struct blk_mq_hw_ctx *hctx; | ||
| 35 | |||
| 36 | hctx = container_of(kobj, struct blk_mq_hw_ctx, kobj); | ||
| 37 | kfree(hctx); | ||
| 38 | } | 18 | } |
| 39 | 19 | ||
| 40 | struct blk_mq_ctx_sysfs_entry { | 20 | struct blk_mq_ctx_sysfs_entry { |
| @@ -338,13 +318,13 @@ static struct kobj_type blk_mq_ktype = { | |||
| 338 | static struct kobj_type blk_mq_ctx_ktype = { | 318 | static struct kobj_type blk_mq_ctx_ktype = { |
| 339 | .sysfs_ops = &blk_mq_sysfs_ops, | 319 | .sysfs_ops = &blk_mq_sysfs_ops, |
| 340 | .default_attrs = default_ctx_attrs, | 320 | .default_attrs = default_ctx_attrs, |
| 341 | .release = blk_mq_ctx_release, | 321 | .release = blk_mq_sysfs_release, |
| 342 | }; | 322 | }; |
| 343 | 323 | ||
| 344 | static struct kobj_type blk_mq_hw_ktype = { | 324 | static struct kobj_type blk_mq_hw_ktype = { |
| 345 | .sysfs_ops = &blk_mq_hw_sysfs_ops, | 325 | .sysfs_ops = &blk_mq_hw_sysfs_ops, |
| 346 | .default_attrs = default_hw_ctx_attrs, | 326 | .default_attrs = default_hw_ctx_attrs, |
| 347 | .release = blk_mq_hctx_release, | 327 | .release = blk_mq_sysfs_release, |
| 348 | }; | 328 | }; |
| 349 | 329 | ||
| 350 | static void blk_mq_unregister_hctx(struct blk_mq_hw_ctx *hctx) | 330 | 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) | |||
| 375 | return ret; | 355 | return ret; |
| 376 | 356 | ||
| 377 | hctx_for_each_ctx(hctx, ctx, i) { | 357 | hctx_for_each_ctx(hctx, ctx, i) { |
| 378 | kobject_get(&q->mq_kobj); | ||
| 379 | ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu); | 358 | ret = kobject_add(&ctx->kobj, &hctx->kobj, "cpu%u", ctx->cpu); |
| 380 | if (ret) | 359 | if (ret) |
| 381 | break; | 360 | break; |
