summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShaohua Li <shli@fb.com>2017-09-26 14:02:12 -0400
committerJens Axboe <axboe@kernel.dk>2017-09-26 14:07:24 -0400
commit0b508bc926bdced678febee2a2b8cdba0a19e481 (patch)
tree79a143e9857e44b1d28628bf88e188cd476db650
parent9979d545c93653770984806e9bfcec1df53a9d3d (diff)
block: fix a build error
The code is only for blkcg not for all cgroups Fixes: d4478e92d618 ("block/loop: make loop cgroup aware") Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Shaohua Li <shli@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/block/loop.c2
-rw-r--r--include/linux/kthread.h2
-rw-r--r--kernel/kthread.c8
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index fd4eff5f5b76..bc8e61506968 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1692,7 +1692,7 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
1692 } 1692 }
1693 1693
1694 /* always use the first bio's css */ 1694 /* always use the first bio's css */
1695#ifdef CONFIG_CGROUPS 1695#ifdef CONFIG_BLK_CGROUP
1696 if (cmd->use_aio && cmd->rq->bio && cmd->rq->bio->bi_css) { 1696 if (cmd->use_aio && cmd->rq->bio && cmd->rq->bio->bi_css) {
1697 cmd->css = cmd->rq->bio->bi_css; 1697 cmd->css = cmd->rq->bio->bi_css;
1698 css_get(cmd->css); 1698 css_get(cmd->css);
diff --git a/include/linux/kthread.h b/include/linux/kthread.h
index bd4369c83dfb..fb201842c635 100644
--- a/include/linux/kthread.h
+++ b/include/linux/kthread.h
@@ -199,7 +199,7 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work);
199 199
200void kthread_destroy_worker(struct kthread_worker *worker); 200void kthread_destroy_worker(struct kthread_worker *worker);
201 201
202#ifdef CONFIG_CGROUPS 202#ifdef CONFIG_BLK_CGROUP
203void kthread_associate_blkcg(struct cgroup_subsys_state *css); 203void kthread_associate_blkcg(struct cgroup_subsys_state *css);
204struct cgroup_subsys_state *kthread_blkcg(void); 204struct cgroup_subsys_state *kthread_blkcg(void);
205#else 205#else
diff --git a/kernel/kthread.c b/kernel/kthread.c
index b011ea08967f..f87cd8b4eb2a 100644
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -46,7 +46,7 @@ struct kthread {
46 void *data; 46 void *data;
47 struct completion parked; 47 struct completion parked;
48 struct completion exited; 48 struct completion exited;
49#ifdef CONFIG_CGROUPS 49#ifdef CONFIG_BLK_CGROUP
50 struct cgroup_subsys_state *blkcg_css; 50 struct cgroup_subsys_state *blkcg_css;
51#endif 51#endif
52}; 52};
@@ -83,7 +83,7 @@ void free_kthread_struct(struct task_struct *k)
83 * or if kmalloc() in kthread() failed. 83 * or if kmalloc() in kthread() failed.
84 */ 84 */
85 kthread = to_kthread(k); 85 kthread = to_kthread(k);
86#ifdef CONFIG_CGROUPS 86#ifdef CONFIG_BLK_CGROUP
87 WARN_ON_ONCE(kthread && kthread->blkcg_css); 87 WARN_ON_ONCE(kthread && kthread->blkcg_css);
88#endif 88#endif
89 kfree(kthread); 89 kfree(kthread);
@@ -224,7 +224,7 @@ static int kthread(void *_create)
224 self->data = data; 224 self->data = data;
225 init_completion(&self->exited); 225 init_completion(&self->exited);
226 init_completion(&self->parked); 226 init_completion(&self->parked);
227#ifdef CONFIG_CGROUPS 227#ifdef CONFIG_BLK_CGROUP
228 self->blkcg_css = NULL; 228 self->blkcg_css = NULL;
229#endif 229#endif
230 current->vfork_done = &self->exited; 230 current->vfork_done = &self->exited;
@@ -1166,7 +1166,7 @@ void kthread_destroy_worker(struct kthread_worker *worker)
1166} 1166}
1167EXPORT_SYMBOL(kthread_destroy_worker); 1167EXPORT_SYMBOL(kthread_destroy_worker);
1168 1168
1169#ifdef CONFIG_CGROUPS 1169#ifdef CONFIG_BLK_CGROUP
1170/** 1170/**
1171 * kthread_associate_blkcg - associate blkcg to current kthread 1171 * kthread_associate_blkcg - associate blkcg to current kthread
1172 * @css: the cgroup info 1172 * @css: the cgroup info