diff options
author | Pekka Enberg <penberg@cs.helsinki.fi> | 2008-01-02 06:07:25 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-02 13:42:39 -0500 |
commit | 6b6adc22a01941165d5af9a3e69e28e948b28f47 (patch) | |
tree | d37ec1318df41660573e09b19282e96288d9acaf /fs/proc/proc_misc.c | |
parent | dc512814b5f8b7b80c74d6170b93a606ae4f36c5 (diff) |
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>
Diffstat (limited to 'fs/proc/proc_misc.c')
-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); |