[CRIU] [PATCH 2/3] uffd: introduce uffd_handle_page

Mike Rapoport rppt at linux.vnet.ibm.com
Thu Mar 31 04:39:20 PDT 2016


so that it'll be able to handle both UFFDIO_COPY and UFFDIO_ZEROPAGE

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/uffd.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/criu/uffd.c b/criu/uffd.c
index 79c693d..425b1d4 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -280,6 +280,11 @@ static int uffd_copy_page(int uffd, __u64 address, void *dest)
 
 }
 
+static int uffd_handle_page(int uffd, __u64 address, void *dest)
+{
+	return uffd_copy_page(uffd, address, dest);
+}
+
 static int collect_uffd_pages(struct page_read *pr, struct list_head *uffd_list)
 {
 	unsigned long base;
@@ -352,7 +357,7 @@ static int handle_remaining_pages(int uffd, struct list_head *uffd_list, void *d
 		if (uffd_pages->flags & UFFD_FLAG_SENT)
 			continue;
 
-		rc = uffd_copy_page(uffd, uffd_pages->addr, dest);
+		rc = uffd_handle_page(uffd, uffd_pages->addr, dest);
 		if (rc < 0) {
 			pr_err("Error during UFFD copy\n");
 			return -1;
@@ -370,7 +375,7 @@ static int handle_regular_pages(int uffd, struct list_head *uffd_list, void *des
 	int rc;
 	struct uffd_pages_struct *uffd_pages;
 
-	rc = uffd_copy_page(uffd, address, dest);
+	rc = uffd_handle_page(uffd, address, dest);
 	if (rc < 0) {
 		pr_err("Error during UFFD copy\n");
 		return -1;
-- 
1.9.1



More information about the CRIU mailing list