[CRIU] [PATCH v3 01/12] vma: rename longest to priv_longest

Eugene Batalov eabatalov89 at gmail.com
Sun Aug 7 06:11:05 PDT 2016


From: Fyodor Bocharov <bocharovfedor at gmail.com>

'longest' field in vma_area_list struct stores longest private vma
size. It is better to name it priv_longest as it is done
for priv_size field.

Signed-off-by: Fyodor Bocharov <fbocharov at yandex.ru>
Signed-off-by: Eugene Batalov <eabatalov89 at gmail.com>
---
 criu/cr-dump.c     | 3 ++-
 criu/include/vma.h | 4 ++--
 criu/mem.c         | 4 ++--
 criu/proc_parse.c  | 4 ++--
 4 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 06ff2d7..60d190f 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -113,7 +113,8 @@ int collect_mappings(pid_t pid, struct vm_area_list *vma_area_list,
 	if (ret < 0)
 		goto err;
 
-	pr_info("Collected, longest area occupies %lu pages\n", vma_area_list->longest);
+	pr_info("Collected, longest area occupies %lu pages\n",
+			vma_area_list->priv_longest);
 	pr_info_vma_list(&vma_area_list->h);
 
 	pr_info("----------------------------------------\n");
diff --git a/criu/include/vma.h b/criu/include/vma.h
index 57fcb74..dae59be 100644
--- a/criu/include/vma.h
+++ b/criu/include/vma.h
@@ -14,7 +14,7 @@ struct vm_area_list {
 	unsigned		nr;
 	unsigned int		nr_aios;
 	unsigned long		priv_size; /* nr of pages in private VMAs */
-	unsigned long		longest; /* nr of pages in longest VMA */
+	unsigned long		priv_longest; /* nr of pages in longest private VMA */
 };
 
 #define VM_AREA_LIST(name)	struct vm_area_list name = { .h = LIST_HEAD_INIT(name.h), .nr = 0, }
@@ -24,7 +24,7 @@ static inline void vm_area_list_init(struct vm_area_list *vml)
 	INIT_LIST_HEAD(&vml->h);
 	vml->nr = 0;
 	vml->priv_size = 0;
-	vml->longest = 0;
+	vml->priv_longest = 0;
 }
 
 struct file_desc;
diff --git a/criu/mem.c b/criu/mem.c
index 23055b5..d4b337a 100644
--- a/criu/mem.c
+++ b/criu/mem.c
@@ -296,14 +296,14 @@ static int __parasite_dump_pages_seized(struct parasite_ctl *ctl,
 	timing_start(TIME_MEMDUMP);
 
 	pr_debug("   Private vmas %lu/%lu pages\n",
-			vma_area_list->longest, vma_area_list->priv_size);
+			vma_area_list->priv_longest, vma_area_list->priv_size);
 
 	/*
 	 * Step 0 -- prepare
 	 */
 
 	if (pmc_init(&pmc, ctl->pid.real, &vma_area_list->h,
-		     vma_area_list->longest * PAGE_SIZE))
+			 vma_area_list->priv_longest * PAGE_SIZE))
 		return -1;
 
 	ret = -1;
diff --git a/criu/proc_parse.c b/criu/proc_parse.c
index b5106c6..477aeb5 100644
--- a/criu/proc_parse.c
+++ b/criu/proc_parse.c
@@ -632,7 +632,7 @@ static int vma_list_add(struct vma_area *vma_area,
 
 		pages = vma_area_len(vma_area) / PAGE_SIZE;
 		vma_area_list->priv_size += pages;
-		vma_area_list->longest = max(vma_area_list->longest, pages);
+		vma_area_list->priv_longest = max(vma_area_list->priv_longest, pages);
 	}
 
 	*prev_vfi = *vfi;
@@ -656,7 +656,7 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list,
 
 	vma_area_list->nr = 0;
 	vma_area_list->nr_aios = 0;
-	vma_area_list->longest = 0;
+	vma_area_list->priv_longest = 0;
 	vma_area_list->priv_size = 0;
 	INIT_LIST_HEAD(&vma_area_list->h);
 
-- 
1.9.1



More information about the CRIU mailing list