The code is only for blkcg not for all cgroups
Unified · Split
| @@ -1692,7 +1692,7 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx, · 1691 unmodified lines | ||
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | /* always use the first bio's css */ |
| 1695 | −#ifdef CONFIG_CGROUPS | |
| 1695 | +#ifdef CONFIG_BLK_CGROUP | |
| 1696 | 1696 | if (cmd->use_aio && cmd->rq->bio && cmd->rq->bio->bi_css) { |
| 1697 | 1697 | cmd->css = cmd->rq->bio->bi_css; |
| 1698 | 1698 | css_get(cmd->css); |
| @@ -199,7 +199,7 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work); · 198 unmodified lines | ||
| 199 | 199 | |
| 200 | 200 | void kthread_destroy_worker(struct kthread_worker *worker); |
| 201 | 201 | |
| 202 | −#ifdef CONFIG_CGROUPS | |
| 202 | +#ifdef CONFIG_BLK_CGROUP | |
| 203 | 203 | void kthread_associate_blkcg(struct cgroup_subsys_state *css); |
| 204 | 204 | struct cgroup_subsys_state *kthread_blkcg(void); |
| 205 | 205 | #else |
| @@ -46,7 +46,7 @@ struct kthread { · 45 unmodified lines | ||
| 46 | 46 | void *data; |
| 47 | 47 | struct completion parked; |
| 48 | 48 | struct completion exited; |
| 49 | −#ifdef CONFIG_CGROUPS | |
| 49 | +#ifdef CONFIG_BLK_CGROUP | |
| 50 | 50 | struct cgroup_subsys_state *blkcg_css; |
| 51 | 51 | #endif |
| 52 | 52 | }; |
| @@ -83,7 +83,7 @@ void free_kthread_struct(struct task_struct *k) · 30 unmodified lines | ||
| 83 | 83 | * or if kmalloc() in kthread() failed. |
| 84 | 84 | */ |
| 85 | 85 | kthread = to_kthread(k); |
| 86 | −#ifdef CONFIG_CGROUPS | |
| 86 | +#ifdef CONFIG_BLK_CGROUP | |
| 87 | 87 | WARN_ON_ONCE(kthread && kthread->blkcg_css); |
| 88 | 88 | #endif |
| 89 | 89 | kfree(kthread); |
| @@ -224,7 +224,7 @@ static int kthread(void *_create) · 134 unmodified lines | ||
| 224 | 224 | self->data = data; |
| 225 | 225 | init_completion(&self->exited); |
| 226 | 226 | init_completion(&self->parked); |
| 227 | −#ifdef CONFIG_CGROUPS | |
| 227 | +#ifdef CONFIG_BLK_CGROUP | |
| 228 | 228 | self->blkcg_css = NULL; |
| 229 | 229 | #endif |
| 230 | 230 | current->vfork_done = &self->exited; |
| @@ -1166,7 +1166,7 @@ void kthread_destroy_worker(struct kthread_worker *worker) · 935 unmodified lines | ||
| 1166 | 1166 | } |
| 1167 | 1167 | EXPORT_SYMBOL(kthread_destroy_worker); |
| 1168 | 1168 | |
| 1169 | −#ifdef CONFIG_CGROUPS | |
| 1169 | +#ifdef CONFIG_BLK_CGROUP | |
| 1170 | 1170 | /** |
| 1171 | 1171 | * kthread_associate_blkcg - associate blkcg to current kthread |
| 1172 | 1172 | * @css: the cgroup info |