Skip to content

Commit f9c8dbc

Browse files
Al Virogregkh
authored andcommitted
slub: don't mess with ->d_name
Signed-off-by: Al Viro <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 74e5a20 commit f9c8dbc

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

mm/slub.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7513,10 +7513,7 @@ static int slab_debug_trace_open(struct inode *inode, struct file *filep)
75137513
return -ENOMEM;
75147514
}
75157515

7516-
if (strcmp(filep->f_path.dentry->d_name.name, "alloc_traces") == 0)
7517-
alloc = TRACK_ALLOC;
7518-
else
7519-
alloc = TRACK_FREE;
7516+
alloc = debugfs_get_aux_num(filep);
75207517

75217518
if (!alloc_loc_track(t, PAGE_SIZE / sizeof(struct location), GFP_KERNEL)) {
75227519
bitmap_free(obj_map);
@@ -7572,11 +7569,11 @@ static void debugfs_slab_add(struct kmem_cache *s)
75727569

75737570
slab_cache_dir = debugfs_create_dir(s->name, slab_debugfs_root);
75747571

7575-
debugfs_create_file("alloc_traces", 0400,
7576-
slab_cache_dir, s, &slab_debugfs_fops);
7572+
debugfs_create_file_aux_num("alloc_traces", 0400, slab_cache_dir, s,
7573+
TRACK_ALLOC, &slab_debugfs_fops);
75777574

7578-
debugfs_create_file("free_traces", 0400,
7579-
slab_cache_dir, s, &slab_debugfs_fops);
7575+
debugfs_create_file_aux_num("free_traces", 0400, slab_cache_dir, s,
7576+
TRACK_FREE, &slab_debugfs_fops);
75807577
}
75817578

75827579
void debugfs_slab_release(struct kmem_cache *s)

0 commit comments

Comments
 (0)