Commit 61413516 authored by Lu Jialin's avatar Lu Jialin
Browse files

psi: fix compile error for psi cgroupv1 when CONFIG_CGROUP=n

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7OOZR



-------------------------------

When CONFIG_CGROUP=n ,the compile error is:
In file included from kernel/sched/core.c:13:
kernel/sched/sched.h:2679:22: error: array type has incomplete element type ‘struct cftype’
 extern struct cftype cgroup_v1_psi_files[];
                      ^~~~~~~~~~~~~~~~~~~
the reason is then CONFIG_CGROUP=n, struct cftype is not defined. We
also find that, cgroup_v1_psi_files is used only in
kernel/cgroup/cgroup.c and kernel/sched/cpuacct.c. Therefore, move
extern struct cftype cgroup_v1_psi_files to kernel/sched/cpuacct.c.This
also solved the compile error, because, then CONFIG_CGROUP=n,
CONFIG_CGROUP_CPUACCT=n, the kernel/sched/cpuacct.c is not compiled,
which will solve the compile error.

Signed-off-by: default avatarLu Jialin <lujialin4@huawei.com>
parent f2b120f2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment