[CRIU] [PATCH 02/10] page-read: replace read_pagemap_page_from_parent with seek_pagemap_page

Tikhomirov Pavel snorcht at gmail.com
Tue Nov 19 02:28:21 PST 2013


Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
---
 page-read.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/page-read.c b/page-read.c
index 43f1b2a..a25590a 100644
--- a/page-read.c
+++ b/page-read.c
@@ -83,7 +83,7 @@ static void skip_pagemap_pages(struct page_read *pr, unsigned long len)
 	pr->cvaddr += len;
 }
 
-static int read_pagemap_page_from_parent(struct page_read *pr, unsigned long vaddr, void *buf, int flags)
+static int seek_pagemap_page(struct page_read *pr, unsigned long vaddr, int flags)
 {
 	int ret;
 	struct iovec iov;
@@ -116,7 +116,7 @@ new_pagemap:
 		}
 
 		skip_pagemap_pages(pr, vaddr - pr->cvaddr);
-		return read_pagemap_page(pr, vaddr, buf);
+		return 0;
 	}
 }
 
@@ -126,7 +126,10 @@ static int read_pagemap_page(struct page_read *pr, unsigned long vaddr, void *bu
 
 	if (pr->pe->in_parent) {
 		pr_debug("\tpr%u Read page %lx from parent\n", pr->id, vaddr);
-		ret = read_pagemap_page_from_parent(pr->parent, vaddr, buf, 0);
+		ret = seek_pagemap_page(pr->parent, vaddr, 0);
+		if (ret == -1)
+			return ret;
+		ret = read_pagemap_page(pr->parent, vaddr, buf);
 		if (ret == -1)
 			return ret;
 	} else {
-- 
1.7.9.5



More information about the CRIU mailing list