mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@in.ibm.com>
To: Andrew Morton <akpm@osdl.org>, lkml <linux-kernel@vger.kernel.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>,
	fastboot <fastboot@lists.osdl.org>
Subject: [RFC/PATCH 12/17][Kdump] Routines for copying dump pages - more fixes
Date: Mon, 28 Mar 2005 18:57:20 +0530	[thread overview]
Message-ID: <1112016440.4001.83.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: crashdump-routines-for-copying-dump-pages-more-fixes.patch --]
[-- Type: message/rfc822, Size: 2186 bytes --]

From: 
Subject: No Subject
Date: Mon, 28 Mar 2005 17:49:54 +0530
Message-ID: <1112012394.4001.52.camel@localhost.localdomain>

From: "Vivek Goyal" <vgoyal@in.ibm.com>

o Enable copy_oldmem_page() to read from a specific offset, with in a page.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
---

 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(-)

diff -puN include/linux/crash_dump.h~crashdump-routines-for-copying-dump-pages-more-fixes include/linux/crash_dump.h
--- linux-2.6.12-rc1-mm1-1M/include/linux/crash_dump.h~crashdump-routines-for-copying-dump-pages-more-fixes	2005-03-22 16:15:55.000000000 +0530
+++ linux-2.6.12-rc1-mm1-1M-root/include/linux/crash_dump.h	2005-03-22 16:15:55.000000000 +0530
@@ -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 */
diff -puN kernel/crash_dump.c~crashdump-routines-for-copying-dump-pages-more-fixes kernel/crash_dump.c
--- linux-2.6.12-rc1-mm1-1M/kernel/crash_dump.c~crashdump-routines-for-copying-dump-pages-more-fixes	2005-03-22 16:15:55.000000000 +0530
+++ linux-2.6.12-rc1-mm1-1M-root/kernel/crash_dump.c	2005-03-22 16:15:55.000000000 +0530
@@ -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 p
 	kunmap_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;
 }
_

                 reply	other threads:[~2005-03-28 13:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1112016440.4001.83.camel@localhost.localdomain \
    --to=vgoyal@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ebiederm@xmission.com \
    --cc=fastboot@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®