summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorXiongwei Song <xiongwei.song@windriver.com>2023-04-13 16:34:49 +0200
committerVlastimil Babka <vbabka@suse.cz>2023-05-22 15:20:21 +0200
commit81bd31793fd3be4fec2818e2267997f56ac18fb2 (patch)
tree4a0cc3ce1786b7b79a67dd0584781b7832ef4e88 /mm
parentslub: Correct the error code when slab_kset is NULL (diff)
downloadlinux-81bd31793fd3be4fec2818e2267997f56ac18fb2.tar.xz
linux-81bd31793fd3be4fec2818e2267997f56ac18fb2.zip
slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block
The SO_ALL|SO_OBJECTS pair is only used when enabling CONFIG_SLUB_DEBUG option, so the objects_show() definition should be surrounded by CONFIG_SLUB_DEBUG too. Signed-off-by: Xiongwei Song <xiongwei.song@windriver.com> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 1202ed1200f9..bd3b00bb865b 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -5612,12 +5612,6 @@ static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf)
}
SLAB_ATTR_RO(cpu_slabs);
-static ssize_t objects_show(struct kmem_cache *s, char *buf)
-{
- return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS);
-}
-SLAB_ATTR_RO(objects);
-
static ssize_t objects_partial_show(struct kmem_cache *s, char *buf)
{
return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS);
@@ -5712,6 +5706,12 @@ static ssize_t total_objects_show(struct kmem_cache *s, char *buf)
}
SLAB_ATTR_RO(total_objects);
+static ssize_t objects_show(struct kmem_cache *s, char *buf)
+{
+ return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS);
+}
+SLAB_ATTR_RO(objects);
+
static ssize_t sanity_checks_show(struct kmem_cache *s, char *buf)
{
return sysfs_emit(buf, "%d\n", !!(s->flags & SLAB_CONSISTENCY_CHECKS));
@@ -5943,7 +5943,6 @@ static struct attribute *slab_attrs[] = {
&order_attr.attr,
&min_partial_attr.attr,
&cpu_partial_attr.attr,
- &objects_attr.attr,
&objects_partial_attr.attr,
&partial_attr.attr,
&cpu_slabs_attr.attr,
@@ -5957,6 +5956,7 @@ static struct attribute *slab_attrs[] = {
&slabs_cpu_partial_attr.attr,
#ifdef CONFIG_SLUB_DEBUG
&total_objects_attr.attr,
+ &objects_attr.attr,
&slabs_attr.attr,
&sanity_checks_attr.attr,
&trace_attr.attr,