proc: move /proc/kmsg creation to fs/proc/kmsg.c
authorAlexey Dobriyan <adobriyan@gmail.com>
Sat, 4 Oct 2008 10:39:12 +0000 (14:39 +0400)
committerAlexey Dobriyan <adobriyan@gmail.com>
Thu, 23 Oct 2008 10:35:08 +0000 (14:35 +0400)
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
fs/proc/internal.h
fs/proc/kmsg.c
fs/proc/proc_misc.c

index d5bf4dec6b0a83e54bc3447705dbf589307ec873..3e8aeb8b61ce251601f8795d3f6bd4fd423beed0 100644 (file)
@@ -61,7 +61,6 @@ extern const struct file_operations proc_smaps_operations;
 extern const struct file_operations proc_clear_refs_operations;
 extern const struct file_operations proc_pagemap_operations;
 extern const struct file_operations proc_net_operations;
-extern const struct file_operations proc_kmsg_operations;
 extern const struct inode_operations proc_net_inode_operations;
 
 void free_proc_entry(struct proc_dir_entry *de);
index 9fd5df3f40ce7d0dcc4f78559fdd5eb2c521da4f..7ca78346d3f0f9ceed2014a42c2c03b774f1393f 100644 (file)
 #include <linux/time.h>
 #include <linux/kernel.h>
 #include <linux/poll.h>
+#include <linux/proc_fs.h>
 #include <linux/fs.h>
 
 #include <asm/uaccess.h>
 #include <asm/io.h>
 
-#include "internal.h"
-
 extern wait_queue_head_t log_wait;
 
 extern int do_syslog(int type, char __user *bug, int count);
@@ -49,9 +48,16 @@ static unsigned int kmsg_poll(struct file *file, poll_table *wait)
 }
 
 
-const struct file_operations proc_kmsg_operations = {
+static const struct file_operations proc_kmsg_operations = {
        .read           = kmsg_read,
        .poll           = kmsg_poll,
        .open           = kmsg_open,
        .release        = kmsg_release,
 };
+
+static int __init proc_kmsg_init(void)
+{
+       proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
+       return 0;
+}
+module_init(proc_kmsg_init);
index e177f42496c43a30198486f9fc89c3ce46b3a73e..fcac25edaef7c753cef49e8b11fad8720ae53348 100644 (file)
@@ -605,9 +605,6 @@ void __init proc_misc_init(void)
        proc_symlink("mounts", NULL, "self/mounts");
 
        /* And now for trickier ones */
-#ifdef CONFIG_PRINTK
-       proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations);
-#endif
 #ifdef CONFIG_FILE_LOCKING
        proc_create("locks", 0, NULL, &proc_locks_operations);
 #endif