[4/7] mem: Add pstree_item arg to dump_pages calls

Submitted by Pavel Emelianov on Sept. 28, 2016, 7:42 a.m.

Details

Message ID 57EB7452.9050102@virtuozzo.com
State Accepted
Series "Prepare parasite_ctl for being internal to compel"
Commit c8ba8b47a4e59d417dd08623750d56489a3cc33b
Headers show

Commit Message

Pavel Emelianov Sept. 28, 2016, 7:42 a.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/cr-dump.c     |  4 ++--
 criu/include/mem.h |  5 +++--
 criu/mem.c         | 12 +++++++-----
 3 files changed, 12 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 2b4e680..a2611ee 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -1179,7 +1179,7 @@  static int pre_dump_one_task(struct pstree_item *item)
 	mdc.pre_dump = true;
 	mdc.lazy = false;
 
-	ret = parasite_dump_pages_seized(parasite_ctl, &vmas, &mdc);
+	ret = parasite_dump_pages_seized(item, &vmas, &mdc, parasite_ctl);
 	if (ret)
 		goto err_cure;
 
@@ -1339,7 +1339,7 @@  static int dump_one_task(struct pstree_item *item)
 	mdc.pre_dump = false;
 	mdc.lazy = opts.lazy_pages;
 
-	ret = parasite_dump_pages_seized(parasite_ctl, &vmas, &mdc);
+	ret = parasite_dump_pages_seized(item, &vmas, &mdc, parasite_ctl);
 	if (ret)
 		goto err_cure;
 
diff --git a/criu/include/mem.h b/criu/include/mem.h
index f1e6b78..f89947b 100644
--- a/criu/include/mem.h
+++ b/criu/include/mem.h
@@ -20,9 +20,10 @@  extern bool page_in_parent(bool dirty);
 extern int prepare_mm_pid(struct pstree_item *i);
 extern int do_task_reset_dirty_track(int pid);
 extern unsigned int dump_pages_args_size(struct vm_area_list *vmas);
-extern int parasite_dump_pages_seized(struct parasite_ctl *ctl,
+extern int parasite_dump_pages_seized(struct pstree_item *item,
 				      struct vm_area_list *vma_area_list,
-				      struct mem_dump_ctl *mdc);
+				      struct mem_dump_ctl *mdc,
+				      struct parasite_ctl *ctl);
 
 #define PME_PRESENT		(1ULL << 63)
 #define PME_SWAP		(1ULL << 62)
diff --git a/criu/mem.c b/criu/mem.c
index 183245e..ddcd55e 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -280,10 +280,11 @@  static int xfer_pages(struct page_pipe *pp, struct page_xfer *xfer, bool lazy)
 	return ret;
 }
 
-static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
+static int __parasite_dump_pages_seized(struct pstree_item *item,
 		struct parasite_dump_pages_args *args,
 		struct vm_area_list *vma_area_list,
-		struct mem_dump_ctl *mdc)
+		struct mem_dump_ctl *mdc,
+		struct parasite_ctl *ctl)
 {
 	pmc_t pmc = PMC_INIT;
 	struct page_pipe *pp;
@@ -419,9 +420,10 @@  out:
 	return ret;
 }
 
-int parasite_dump_pages_seized(struct parasite_ctl *ctl,
+int parasite_dump_pages_seized(struct pstree_item *item,
 		struct vm_area_list *vma_area_list,
-		struct mem_dump_ctl *mdc)
+		struct mem_dump_ctl *mdc,
+		struct parasite_ctl *ctl)
 {
 	int ret;
 	struct parasite_dump_pages_args *pargs;
@@ -448,7 +450,7 @@  int parasite_dump_pages_seized(struct parasite_ctl *ctl,
 		return -1;
 	}
 
-	ret = __parasite_dump_pages_seized(ctl, pargs, vma_area_list, mdc);
+	ret = __parasite_dump_pages_seized(item, pargs, vma_area_list, mdc, ctl);
 	if (ret) {
 		pr_err("Can't dump page with parasite\n");
 		/* Parasite will unprotect VMAs after fail in fini() */