[CRIU] [PATCH 3/7] pagemap: seek_pagemap: drop skip_zero parameter
Mike Rapoport
rppt at linux.vnet.ibm.com
Thu Dec 15 04:10:39 PST 2016
and always skip zero pagemaps during seeks
Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
criu/include/pagemap.h | 3 +--
criu/page-xfer.c | 2 +-
criu/pagemap.c | 7 +++----
criu/uffd.c | 2 +-
4 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/criu/include/pagemap.h b/criu/include/pagemap.h
index f51b65a..028bf1c 100644
--- a/criu/include/pagemap.h
+++ b/criu/include/pagemap.h
@@ -51,8 +51,7 @@ struct page_read {
void (*close)(struct page_read *);
void (*skip_pages)(struct page_read *, unsigned long len);
int (*sync)(struct page_read *pr);
- int (*seek_pagemap)(struct page_read *pr, unsigned long vaddr,
- bool skip_zero);
+ int (*seek_pagemap)(struct page_read *pr, unsigned long vaddr);
void (*reset)(struct page_read *pr);
int (*io_complete)(struct page_read *, unsigned long vaddr, int nr);
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index 41e6c8a..a22ea3a 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -208,7 +208,7 @@ static int check_pagehole_in_parent(struct page_read *p, struct iovec *iov)
while (1) {
unsigned long pend;
- ret = p->seek_pagemap(p, off, true);
+ ret = p->seek_pagemap(p, off);
if (ret <= 0 || !p->pe) {
pr_err("Missing %lx in parent pagemap\n", off);
return -1;
diff --git a/criu/pagemap.c b/criu/pagemap.c
index 1febba1..a211ff2 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -144,8 +144,7 @@ static void skip_pagemap_pages(struct page_read *pr, unsigned long len)
pr->cvaddr += len;
}
-static int seek_pagemap(struct page_read *pr, unsigned long vaddr,
- bool skip_zero)
+static int seek_pagemap(struct page_read *pr, unsigned long vaddr)
{
if (!pr->pe)
goto adv;
@@ -167,14 +166,14 @@ static int seek_pagemap(struct page_read *pr, unsigned long vaddr,
skip_pagemap_pages(pr, end - pr->cvaddr);
adv:
; /* otherwise "label at end of compound stmt" gcc error */
- } while (advance(pr, skip_zero));
+ } while (advance(pr, true));
return 0;
}
static int seek_pagemap_page(struct page_read *pr, unsigned long vaddr)
{
- if (seek_pagemap(pr, vaddr, true)) {
+ if (seek_pagemap(pr, vaddr)) {
skip_pagemap_pages(pr, vaddr - pr->cvaddr);
return 1;
}
diff --git a/criu/uffd.c b/criu/uffd.c
index c66a187..f761edd 100644
--- a/criu/uffd.c
+++ b/criu/uffd.c
@@ -587,7 +587,7 @@ static int uffd_seek_or_zero_pages(struct lazy_pages_info *lpi, __u64 address,
lpi->pr.reset(&lpi->pr);
- ret = lpi->pr.seek_pagemap(&lpi->pr, address, true);
+ ret = lpi->pr.seek_pagemap(&lpi->pr, address);
if (!ret)
return uffd_zero(lpi, address, nr);
--
1.9.1
More information about the CRIU
mailing list