diff options
| -rw-r--r-- | fs/proc/proc_misc.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index e0d064e9764e..a11968bc0516 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
| @@ -451,6 +451,20 @@ static const struct file_operations proc_slabstats_operations = { | |||
| 451 | #endif | 451 | #endif |
| 452 | #endif | 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 | static int show_stat(struct seq_file *p, void *v) | 468 | static int show_stat(struct seq_file *p, void *v) |
| 455 | { | 469 | { |
| 456 | int i; | 470 | int i; |
| @@ -734,6 +748,9 @@ void __init proc_misc_init(void) | |||
| 734 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); | 748 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); |
| 735 | #endif | 749 | #endif |
| 736 | #endif | 750 | #endif |
| 751 | #ifdef CONFIG_SLUB | ||
| 752 | create_seq_entry("slabinfo", S_IWUSR|S_IRUGO, &proc_slabinfo_operations); | ||
| 753 | #endif | ||
| 737 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); | 754 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); |
| 738 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); | 755 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); |
| 739 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); | 756 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); |
