]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/binfmt_elf.c
oom: add per-zone locking
[linux-2.6-omap-h63xx.git] / fs / binfmt_elf.c
index 4482a0673b1591869c63358a1db6a21582848252..2f31c4c3fd48500fc236564e787bb47d2c093289 100644 (file)
@@ -1411,7 +1411,7 @@ struct elf_thread_status
        elf_fpregset_t fpu;             /* NT_PRFPREG */
        struct task_struct *thread;
 #ifdef ELF_CORE_COPY_XFPREGS
-       elf_fpxregset_t xfpu;           /* NT_PRXFPREG */
+       elf_fpxregset_t xfpu;           /* ELF_CORE_XFPREG_TYPE */
 #endif
        struct memelfnote notes[3];
        int num_notes;
@@ -1446,8 +1446,8 @@ static int elf_dump_thread_status(long signr, struct elf_thread_status *t)
 
 #ifdef ELF_CORE_COPY_XFPREGS
        if (elf_core_copy_task_xfpregs(p, &t->xfpu)) {
-               fill_note(&t->notes[2], "LINUX", NT_PRXFPREG, sizeof(t->xfpu),
-                         &t->xfpu);
+               fill_note(&t->notes[2], "LINUX", ELF_CORE_XFPREG_TYPE,
+                         sizeof(t->xfpu), &t->xfpu);
                t->num_notes++;
                sz += notesize(&t->notes[2]);
        }
@@ -1514,9 +1514,6 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
        int thread_status_size = 0;
        elf_addr_t *auxv;
        unsigned long mm_flags;
-#ifdef ELF_CORE_WRITE_EXTRA_NOTES
-       int extra_notes_size;
-#endif
 
        /*
         * We no longer stop all VM operations.
@@ -1624,7 +1621,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
 #ifdef ELF_CORE_COPY_XFPREGS
        if (elf_core_copy_task_xfpregs(current, xfpu))
                fill_note(notes + numnote++,
-                         "LINUX", NT_PRXFPREG, sizeof(*xfpu), xfpu);
+                         "LINUX", ELF_CORE_XFPREG_TYPE, sizeof(*xfpu), xfpu);
 #endif 
   
        fs = get_fs();
@@ -1645,10 +1642,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                
                sz += thread_status_size;
 
-#ifdef ELF_CORE_WRITE_EXTRA_NOTES
-               extra_notes_size = ELF_CORE_EXTRA_NOTES_SIZE;
-               sz += extra_notes_size;
-#endif
+               sz += elf_coredump_extra_notes_size();
 
                fill_elf_note_phdr(&phdr, sz, offset);
                offset += sz;
@@ -1698,10 +1692,8 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                if (!writenote(notes + i, file, &foffset))
                        goto end_coredump;
 
-#ifdef ELF_CORE_WRITE_EXTRA_NOTES
-       ELF_CORE_WRITE_EXTRA_NOTES;
-       foffset += extra_notes_size;
-#endif
+       if (elf_coredump_extra_notes_write(file, &foffset))
+               goto end_coredump;
 
        /* write out the thread status notes section */
        list_for_each(t, &thread_list) {
@@ -1733,7 +1725,7 @@ static int elf_core_dump(long signr, struct pt_regs *regs, struct file *file)
                                                &page, &vma) <= 0) {
                                DUMP_SEEK(PAGE_SIZE);
                        } else {
-                               if (page == ZERO_PAGE(addr)) {
+                               if (page == ZERO_PAGE(0)) {
                                        if (!dump_seek(file, PAGE_SIZE)) {
                                                page_cache_release(page);
                                                goto end_coredump;