summaryrefslogtreecommitdiffstats
path: root/mm/vmstat.c
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-10-06 04:15:36 +0400
committerAlexey Dobriyan <adobriyan@gmail.com>2008-10-23 16:33:29 +0400
commit74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef (patch)
tree1de0e09b982c8c152f93b74842587e4c56df5484 /mm/vmstat.c
parent8f32f7e5ac2ed11b0659b6b55af926f3d58ffd9d (diff)
downloadlinux-74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef.tar.gz
linux-74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef.tar.bz2
linux-74e2e8e8ce7b3c0f878a349f9fa6cf2831548eef.zip
proc: move /proc/pagetypeinfo boilerplate to mm/vmstat.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'mm/vmstat.c')
-rw-r--r--mm/vmstat.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/mm/vmstat.c b/mm/vmstat.c
index f45d7245a282..d624d251946d 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -600,13 +600,25 @@ static const struct file_operations fragmentation_file_operations = {
.release = seq_release,
};
-const struct seq_operations pagetypeinfo_op = {
+static const struct seq_operations pagetypeinfo_op = {
.start = frag_start,
.next = frag_next,
.stop = frag_stop,
.show = pagetypeinfo_show,
};
+static int pagetypeinfo_open(struct inode *inode, struct file *file)
+{
+ return seq_open(file, &pagetypeinfo_op);
+}
+
+static const struct file_operations pagetypeinfo_file_ops = {
+ .open = pagetypeinfo_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
#ifdef CONFIG_ZONE_DMA
#define TEXT_FOR_DMA(xx) xx "_dma",
#else
@@ -925,6 +937,7 @@ static int __init setup_vmstat(void)
#endif
#ifdef CONFIG_PROC_FS
proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
+ proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops);
#endif
return 0;
}