[CRIU] [PATCH 1/2] page-read: replace read_pagemap_page_from_parent with seek_pagemap_page

Tikhomirov Pavel snorcht at gmail.com
Thu Oct 17 06:07:39 PDT 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 78b1303..a3ea7ac 100644
--- a/page-read.c
+++ b/page-read.c
@@ -82,7 +82,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)
+static int seek_pagemap_page(struct page_read *pr, unsigned long vaddr)
 {
 	int ret;
 	struct iovec iov;
@@ -110,7 +110,7 @@ new_pagemap:
 		}
 
 		skip_pagemap_pages(pr, vaddr - pr->cvaddr);
-		return read_pagemap_page(pr, vaddr, buf);
+		return 0;
 	}
 }
 
@@ -120,7 +120,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);
+		ret = seek_pagemap_page(pr->parent, vaddr);
+		if (ret == -1)
+			return ret;
+		ret = read_pagemap_page(pr->parent, vaddr, buf);
 	} else {
 		pr_debug("\tpr%u Read page %lx from self %lx/%"PRIx64"\n", pr->id,
 				vaddr, pr->cvaddr, lseek(pr->fd_pg, 0, SEEK_CUR));
-- 
1.7.9.5



More information about the CRIU mailing list