mm/slub: Define struct slab fields for CONFIG_SLUB_CPU_PARTIAL only when enabled
The fields 'next' and 'slabs' are only used when CONFIG_SLUB_CPU_PARTIAL is enabled. We can put their definition to #ifdef to prevent accidental use when disabled. Currenlty show_slab_objects() and slabs_cpu_partial_show() contain code accessing the slabs field that's effectively dead with CONFIG_SLUB_CPU_PARTIAL=n through the wrappers slub_percpu_partial() and slub_percpu_partial_read_once(), but to prevent a compile error, we need to hide all this code behind #ifdef. Signed-off-by: NVlastimil Babka <vbabka@suse.cz> Reviewed-by: NHyeonggon Yoo <42.hyeyoo@gmail.com> Reviewed-by: NRoman Gushchin <guro@fb.com> Tested-by: NHyeonggon Yoo <42.hyeyoo@gmail.com>
Showing
想要评论请 注册 或 登录