diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-06 06:36:31 -0400 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2008-10-23 10:51:22 -0400 |
commit | 5aa140c2deca3701238d5acddf436ad7b02664c7 (patch) | |
tree | 25cd153f4592aa66fd6459a650fab3b48052f066 | |
parent | 6d80e53f0056178c63fa8fbf3e8de40fb4df5f50 (diff) |
proc: move /proc/vmcore creation to fs/proc/vmcore.c
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
-rw-r--r-- | fs/proc/proc_misc.c | 3 | ||||
-rw-r--r-- | fs/proc/vmcore.c | 6 | ||||
-rw-r--r-- | include/linux/crash_dump.h | 2 |
3 files changed, 3 insertions, 8 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c index 2ef9ef9bc8c1..e2db35006c05 100644 --- a/fs/proc/proc_misc.c +++ b/fs/proc/proc_misc.c | |||
@@ -62,7 +62,4 @@ void __init proc_misc_init(void) | |||
62 | proc_symlink("mounts", NULL, "self/mounts"); | 62 | proc_symlink("mounts", NULL, "self/mounts"); |
63 | 63 | ||
64 | /* And now for trickier ones */ | 64 | /* And now for trickier ones */ |
65 | #ifdef CONFIG_PROC_VMCORE | ||
66 | proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); | ||
67 | #endif | ||
68 | } | 65 | } |
diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index cd9ca67f841b..03ec59504906 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c | |||
@@ -32,7 +32,7 @@ static size_t elfcorebuf_sz; | |||
32 | /* Total size of vmcore file. */ | 32 | /* Total size of vmcore file. */ |
33 | static u64 vmcore_size; | 33 | static u64 vmcore_size; |
34 | 34 | ||
35 | struct proc_dir_entry *proc_vmcore = NULL; | 35 | static struct proc_dir_entry *proc_vmcore = NULL; |
36 | 36 | ||
37 | /* Reads a page from the oldmem device from given offset. */ | 37 | /* Reads a page from the oldmem device from given offset. */ |
38 | static ssize_t read_from_oldmem(char *buf, size_t count, | 38 | static ssize_t read_from_oldmem(char *buf, size_t count, |
@@ -162,7 +162,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, | |||
162 | return acc; | 162 | return acc; |
163 | } | 163 | } |
164 | 164 | ||
165 | const struct file_operations proc_vmcore_operations = { | 165 | static const struct file_operations proc_vmcore_operations = { |
166 | .read = read_vmcore, | 166 | .read = read_vmcore, |
167 | }; | 167 | }; |
168 | 168 | ||
@@ -652,7 +652,7 @@ static int __init vmcore_init(void) | |||
652 | return rc; | 652 | return rc; |
653 | } | 653 | } |
654 | 654 | ||
655 | /* Initialize /proc/vmcore size if proc is already up. */ | 655 | proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); |
656 | if (proc_vmcore) | 656 | if (proc_vmcore) |
657 | proc_vmcore->size = vmcore_size; | 657 | proc_vmcore->size = vmcore_size; |
658 | return 0; | 658 | return 0; |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 0acf3b737e2e..2dac064d8359 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -14,8 +14,6 @@ extern unsigned long long elfcorehdr_addr; | |||
14 | 14 | ||
15 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, | 15 | extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, |
16 | unsigned long, int); | 16 | unsigned long, int); |
17 | extern const struct file_operations proc_vmcore_operations; | ||
18 | extern struct proc_dir_entry *proc_vmcore; | ||
19 | 17 | ||
20 | /* Architecture code defines this if there are other possible ELF | 18 | /* Architecture code defines this if there are other possible ELF |
21 | * machine types, e.g. on bi-arch capable hardware. */ | 19 | * machine types, e.g. on bi-arch capable hardware. */ |