Routines for copying dump pages - more fixes
PATCH 12/17 Routines for copying dump pages - more fixes
From: "Vivek Goyal" <[email protected]>
o Enable copy_oldmem_page() to read from a specific offset, with in a page.
Signed-off-by Vivek Goyal <[email protected]>
---
linux-2.6.12-rc1-mm1-1M-root/include/linux/crash_dump.h | 3 ++- linux-2.6.12-rc1-mm1-1M-root/kernel/crash_dump.c | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-)
include/linux/crash_dump.h renamed from include/linux/crash_dump.h~crashdump-routines-for-copying-dump-pages-more-fixes +2 -1
@@ -7,6 +7,7 @@#include <linux/device.h> #include <linux/proc_fs.h> -extern ssize_t copy_oldmem_page (unsigned long ,char *,size_t ,int ); +extern ssize_t copy_oldmem_page (unsigned long ,char *,size_t , +unsigned long ,int );#endif /* CONFIG_CRASH_DUMP */ #endif /* LINUX_CRASHDUMP_H */
kernel/crash_dump.c renamed from kernel/crash_dump.c~crashdump-routines-for-copying-dump-pages-more-fixes +5 -5
@@ -20,7 +20,7 @@* in the current kernel. We stitch up a pte, similar to kmap_atomic. */ ssize_t copy_oldmem_page (unsigned long pfn,char *buf, -size_t csize,int userbuf) +size_t csize,unsigned long offset,int userbuf) {void *page, *vaddr;
@@ -36,14 +36,14 @@ ssize_t copy_oldmem_page(unsigned long pkunmap_atomic (vaddr,KM_PTE0 );if (userbuf) { -if (copy_to_user (buf, page, csize)) { +if (copy_to_user (buf, (page + offset), csize)) {kfree (page);return -EFAULT ; } }else { -memcpy (buf, page, csize); +memcpy (buf, (page + offset), csize); } -kfree (page); -return 0 ; +kfree (page); +return csize; }
_