]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/proc/vmcore.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-omap-h63xx.git] / fs / proc / vmcore.c
index 841368b87a29dbb89c68c4539b6203a7e0501905..03ec595049065f41b2513d9b94e76058a02ebfec 100644 (file)
@@ -32,10 +32,7 @@ static size_t elfcorebuf_sz;
 /* Total size of vmcore file. */
 static u64 vmcore_size;
 
-/* Stores the physical address of elf header of crash image. */
-unsigned long long elfcorehdr_addr = ELFCORE_ADDR_MAX;
-
-struct proc_dir_entry *proc_vmcore = NULL;
+static struct proc_dir_entry *proc_vmcore = NULL;
 
 /* Reads a page from the oldmem device from given offset. */
 static ssize_t read_from_oldmem(char *buf, size_t count,
@@ -165,7 +162,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer,
        return acc;
 }
 
-const struct file_operations proc_vmcore_operations = {
+static const struct file_operations proc_vmcore_operations = {
        .read           = read_vmcore,
 };
 
@@ -647,7 +644,7 @@ static int __init vmcore_init(void)
        int rc = 0;
 
        /* If elfcorehdr= has been passed in cmdline, then capture the dump.*/
-       if (!(elfcorehdr_addr < ELFCORE_ADDR_MAX))
+       if (!(is_vmcore_usable()))
                return rc;
        rc = parse_crash_elf_headers();
        if (rc) {
@@ -655,7 +652,7 @@ static int __init vmcore_init(void)
                return rc;
        }
 
-       /* Initialize /proc/vmcore size if proc is already up. */
+       proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations);
        if (proc_vmcore)
                proc_vmcore->size = vmcore_size;
        return 0;