diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-05 20:15:36 -0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-23 08:33:29 -0400 |
commit | 74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef (patch) | |
tree | 1de0e09b982c8c152f93b74842587e4c56df5484 /mm | |
parent | 8f32f7e5ac2ed11b0659b6b55af926f3d58ffd9d (diff) |
proc: move /proc/pagetypeinfo boilerplate to mm/vmstat.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/vmstat.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c index f45d7245a28..d624d251946 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
@@ -600,13 +600,25 @@ static const struct file_operations fragmentation_file_operations = { | |||
600 | .release = seq_release, | 600 | .release = seq_release, |
601 | }; | 601 | }; |
602 | 602 | ||
603 | const struct seq_operations pagetypeinfo_op = { | 603 | static const struct seq_operations pagetypeinfo_op = { |
604 | .start = frag_start, | 604 | .start = frag_start, |
605 | .next = frag_next, | 605 | .next = frag_next, |
606 | .stop = frag_stop, | 606 | .stop = frag_stop, |
607 | .show = pagetypeinfo_show, | 607 | .show = pagetypeinfo_show, |
608 | }; | 608 | }; |
609 | 609 | ||
610 | static int pagetypeinfo_open(struct inode *inode, struct file *file) | ||
611 | { | ||
612 | return seq_open(file, &pagetypeinfo_op); | ||
613 | } | ||
614 | |||
615 | static const struct file_operations pagetypeinfo_file_ops = { | ||
616 | .open = pagetypeinfo_open, | ||
617 | .read = seq_read, | ||
618 | .llseek = seq_lseek, | ||
619 | .release = seq_release, | ||
620 | }; | ||
621 | |||
610 | #ifdef CONFIG_ZONE_DMA | 622 | #ifdef CONFIG_ZONE_DMA |
611 | #define TEXT_FOR_DMA(xx) xx "_dma", | 623 | #define TEXT_FOR_DMA(xx) xx "_dma", |
612 | #else | 624 | #else |
@@ -925,6 +937,7 @@ static int __init setup_vmstat(void) | |||
925 | #endif | 937 | #endif |
926 | #ifdef CONFIG_PROC_FS | 938 | #ifdef CONFIG_PROC_FS |
927 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); | 939 | proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); |
940 | proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); | ||
928 | #endif | 941 | #endif |
929 | return 0; | 942 | return 0; |
930 | } | 943 | } |