提交 068ff3ea 编写于 作者: L Liu Shixin 提交者: Zheng Zengkai

dynamic_hugetlb: fix undefined struct cftype

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I576NI
CVE: NA
backport: openEuler-22.03-LTS

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

There is a build warning when !CONFIG_CGROUPS:

In file included from ./include/linux/memcontrol.h:25,
                 from ./include/linux/swap.h:10,
                 from ./include/linux/suspend.h:5,
                 from drivers/cpuidle/cpuidle.c:23:
./include/linux/dynamic_hugetlb.h:115:47: warning: ‘struct cftype’ declared
inside parameter list will not be visible outside of this definition or
declaration
  115 | static inline bool dhugetlb_hide_files(struct cftype *cft)
      |                                               ^~~~~~

Since the function is only invoked when CONFIG_CGROUPS enabled, we can fix it
by restricting its definition to on CONFIG_CGROUPS.
Signed-off-by: NLiu Shixin <liushixin2@huawei.com>
Reviewed-by: NKefeng Wang <wangkefeng.wang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 f2a3dccc
......@@ -112,10 +112,12 @@ void free_huge_page_to_dhugetlb_pool(struct page *page, bool restore_reserve);
struct dhugetlb_pool {};
#ifdef CONFIG_CGROUPS
static inline bool dhugetlb_hide_files(struct cftype *cft)
{
return false;
}
#endif
static inline void hugetlb_pool_inherit(struct mem_cgroup *memcg, struct mem_cgroup *parent)
{
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册