Commit 9c01e9a
committed
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: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>
Reviewed-by: Roman Gushchin <guro@fb.com>
Tested-by: Hyeonggon Yoo <42.hyeyoo@gmail.com>1 parent 662188c commit 9c01e9a
2 files changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| 33 | + | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5258 | 5258 | | |
5259 | 5259 | | |
5260 | 5260 | | |
| 5261 | + | |
5261 | 5262 | | |
5262 | 5263 | | |
5263 | 5264 | | |
| |||
5270 | 5271 | | |
5271 | 5272 | | |
5272 | 5273 | | |
| 5274 | + | |
5273 | 5275 | | |
5274 | 5276 | | |
5275 | 5277 | | |
| |||
5469 | 5471 | | |
5470 | 5472 | | |
5471 | 5473 | | |
5472 | | - | |
| 5474 | + | |
5473 | 5475 | | |
5474 | 5476 | | |
| 5477 | + | |
5475 | 5478 | | |
5476 | 5479 | | |
5477 | 5480 | | |
| |||
5480 | 5483 | | |
5481 | 5484 | | |
5482 | 5485 | | |
| 5486 | + | |
5483 | 5487 | | |
5484 | 5488 | | |
5485 | 5489 | | |
5486 | 5490 | | |
5487 | 5491 | | |
5488 | | - | |
| 5492 | + | |
5489 | 5493 | | |
5490 | 5494 | | |
5491 | 5495 | | |
| |||
0 commit comments