diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-02 16:04:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-01-02 16:04:48 -0500 |
commit | 158a962422e4a54dc256b6a9b9562f3d30d34d9c (patch) | |
tree | 21a71d7d671d12388f4b085e31b0258d1047f125 /fs/proc | |
parent | 6b6adc22a01941165d5af9a3e69e28e948b28f47 (diff) |
Unify /proc/slabinfo configuration
Both SLUB and SLAB really did almost exactly the same thing for
/proc/slabinfo setup, using duplicate code and per-allocator #ifdef's.
This just creates a common CONFIG_SLABINFO that is enabled by both SLUB
and SLAB, and shares all the setup code. Maybe SLOB will want this some
day too.
Reviewed-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/proc_misc.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index a11968bc0516..3462bfde89f6 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -410,7 +410,7 @@ static const struct file_operations proc_modules_operations = { | |||
410 | }; | 410 | }; |
411 | #endif | 411 | #endif |
412 | 412 | ||
413 | #ifdef CONFIG_SLAB | 413 | #ifdef CONFIG_SLABINFO |
414 | static int slabinfo_open(struct inode *inode, struct file *file) | 414 | static int slabinfo_open(struct inode *inode, struct file *file) |
415 | { | 415 | { |
416 | return seq_open(file, &slabinfo_op); | 416 | return seq_open(file, &slabinfo_op); |
@@ -451,20 +451,6 @@ 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 | |||
468 | static int show_stat(struct seq_file *p, void *v) | 454 | static int show_stat(struct seq_file *p, void *v) |
469 | { | 455 | { |
470 | int i; | 456 | int i; |
@@ -742,15 +728,12 @@ void __init proc_misc_init(void) | |||
742 | #endif | 728 | #endif |
743 | create_seq_entry("stat", 0, &proc_stat_operations); | 729 | create_seq_entry("stat", 0, &proc_stat_operations); |
744 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); | 730 | create_seq_entry("interrupts", 0, &proc_interrupts_operations); |
745 | #ifdef CONFIG_SLAB | 731 | #ifdef CONFIG_SLABINFO |
746 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); | 732 | create_seq_entry("slabinfo",S_IWUSR|S_IRUGO,&proc_slabinfo_operations); |
747 | #ifdef CONFIG_DEBUG_SLAB_LEAK | 733 | #ifdef CONFIG_DEBUG_SLAB_LEAK |
748 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); | 734 | create_seq_entry("slab_allocators", 0 ,&proc_slabstats_operations); |
749 | #endif | 735 | #endif |
750 | #endif | 736 | #endif |
751 | #ifdef CONFIG_SLUB | ||
752 | create_seq_entry("slabinfo", S_IWUSR|S_IRUGO, &proc_slabinfo_operations); | ||
753 | #endif | ||
754 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); | 737 | create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); |
755 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); | 738 | create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops); |
756 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); | 739 | create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); |