Skip to content

Commit 0b508bc

Browse files
shligitaxboe
authored andcommitted
block: fix a build error
The code is only for blkcg not for all cgroups Fixes: d4478e9 ("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>
1 parent 9979d54 commit 0b508bc

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎drivers/block/loop.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1692,7 +1692,7 @@ static blk_status_t loop_queue_rq(struct blk_mq_hw_ctx *hctx,
16921692
}
16931693

16941694
/* always use the first bio's css */
1695-
#ifdef CONFIG_CGROUPS
1695+
#ifdef CONFIG_BLK_CGROUP
16961696
if (cmd->use_aio && cmd->rq->bio && cmd->rq->bio->bi_css) {
16971697
cmd->css = cmd->rq->bio->bi_css;
16981698
css_get(cmd->css);

‎include/linux/kthread.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ bool kthread_cancel_delayed_work_sync(struct kthread_delayed_work *work);
199199

200200
void kthread_destroy_worker(struct kthread_worker *worker);
201201

202-
#ifdef CONFIG_CGROUPS
202+
#ifdef CONFIG_BLK_CGROUP
203203
void kthread_associate_blkcg(struct cgroup_subsys_state *css);
204204
struct cgroup_subsys_state *kthread_blkcg(void);
205205
#else

‎kernel/kthread.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ struct kthread {
4646
void *data;
4747
struct completion parked;
4848
struct completion exited;
49-
#ifdef CONFIG_CGROUPS
49+
#ifdef CONFIG_BLK_CGROUP
5050
struct cgroup_subsys_state *blkcg_css;
5151
#endif
5252
};
@@ -83,7 +83,7 @@ void free_kthread_struct(struct task_struct *k)
8383
* or if kmalloc() in kthread() failed.
8484
*/
8585
kthread = to_kthread(k);
86-
#ifdef CONFIG_CGROUPS
86+
#ifdef CONFIG_BLK_CGROUP
8787
WARN_ON_ONCE(kthread && kthread->blkcg_css);
8888
#endif
8989
kfree(kthread);
@@ -224,7 +224,7 @@ static int kthread(void *_create)
224224
self->data = data;
225225
init_completion(&self->exited);
226226
init_completion(&self->parked);
227-
#ifdef CONFIG_CGROUPS
227+
#ifdef CONFIG_BLK_CGROUP
228228
self->blkcg_css = NULL;
229229
#endif
230230
current->vfork_done = &self->exited;
@@ -1166,7 +1166,7 @@ void kthread_destroy_worker(struct kthread_worker *worker)
11661166
}
11671167
EXPORT_SYMBOL(kthread_destroy_worker);
11681168

1169-
#ifdef CONFIG_CGROUPS
1169+
#ifdef CONFIG_BLK_CGROUP
11701170
/**
11711171
* kthread_associate_blkcg - associate blkcg to current kthread
11721172
* @css: the cgroup info

0 commit comments

Comments
 (0)