Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

slub: register slabinfo to procfs

We need to register slabinfo to procfs when CONFIG_SLUB is enabled to
make the file actually visible to user-space.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Pekka Enberg and committed by
Linus Torvalds
6b6adc22 dc512814

+17
+17
fs/proc/proc_misc.c
··· 451 451 #endif 452 452 #endif 453 453 454 + #ifdef CONFIG_SLUB 455 + static int slabinfo_open(struct inode *inode, struct file *file) 456 + { 457 + return seq_open(file, &slabinfo_op); 458 + } 459 + 460 + static const struct file_operations proc_slabinfo_operations = { 461 + .open = slabinfo_open, 462 + .read = seq_read, 463 + .llseek = seq_lseek, 464 + .release = seq_release, 465 + }; 466 + #endif 467 + 454 468 static int show_stat(struct seq_file *p, void *v) 455 469 { 456 470 int i; ··· 747 733 #ifdef CONFIG_DEBUG_SLAB_LEAK 748 734 create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); 749 735 #endif 736 + #endif 737 + #ifdef CONFIG_SLUB 738 + create_seq_entry("slabinfo", S_IWUSR|S_IRUGO, &proc_slabinfo_operations); 750 739 #endif 751 740 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); 752 741 create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops);