[CRIU] [PATCH v5 1/5] Make skip_pages function available criu-wide

Adrian Reber adrian at lisas.de
Wed Mar 9 23:39:50 PST 2016


From: Adrian Reber <areber at redhat.com>

For the upcoming userfaultfd integration the skip_pages functionality is
required to find the userfaultfd requested pages.

Signed-off-by: Adrian Reber <areber at redhat.com>
---
 criu/include/page-read.h | 1 +
 criu/page-read.c         | 2 ++
 2 files changed, 3 insertions(+)

diff --git a/criu/include/page-read.h b/criu/include/page-read.h
index 8951a72..3ba1ee9 100644
--- a/criu/include/page-read.h
+++ b/criu/include/page-read.h
@@ -51,6 +51,7 @@ struct page_read {
 	/* stop working on current pagemap */
 	void (*put_pagemap)(struct page_read *);
 	void (*close)(struct page_read *);
+	void (*skip_pages)(struct page_read *, unsigned long len);
 
 	/* Private data of reader */
 	struct cr_img *pmi;
diff --git a/criu/page-read.c b/criu/page-read.c
index a185265..e5ec76a 100644
--- a/criu/page-read.c
+++ b/criu/page-read.c
@@ -328,6 +328,7 @@ int open_page_read_at(int dfd, int pid, struct page_read *pr, int pr_flags)
 	pr->put_pagemap = put_pagemap;
 	pr->read_pages = read_pagemap_page;
 	pr->close = close_page_read;
+	pr->skip_pages = skip_pagemap_pages;
 	pr->id = ids++;
 
 	pr_debug("Opened page read %u (parent %u)\n",
@@ -350,6 +351,7 @@ open_old:
 	pr->read_pages = read_page;
 	pr->pi = NULL;
 	pr->close = close_page_read;
+	pr->skip_pages = NULL;
 
 	return 1;
 }
-- 
1.8.3.1



More information about the CRIU mailing list