2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

mem/vma: Use vm_area_list_init where appropriate

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Reviewed-by: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Cyrill Gorcunov
2019-07-05 18:38:01 +03:00
committed by Andrei Vagin
parent 6e86b9eb01
commit 32e9f15525
2 changed files with 4 additions and 12 deletions

View File

@@ -108,8 +108,7 @@ void free_mappings(struct vm_area_list *vma_area_list)
free(vma_area);
}
INIT_LIST_HEAD(&vma_area_list->h);
vma_area_list->nr = 0;
vm_area_list_init(vma_area_list);
}
int collect_mappings(pid_t pid, struct vm_area_list *vma_area_list,
@@ -1142,8 +1141,7 @@ static int pre_dump_one_task(struct pstree_item *item, InventoryEntry *parent_ie
struct parasite_dump_misc misc;
struct mem_dump_ctl mdc;
INIT_LIST_HEAD(&vmas.h);
vmas.nr = 0;
vm_area_list_init(&vmas);
pr_info("========================================\n");
pr_info("Pre-dumping task (pid: %d)\n", pid);
@@ -1224,8 +1222,7 @@ static int dump_one_task(struct pstree_item *item, InventoryEntry *parent_ie)
struct proc_posix_timers_stat proc_args;
struct mem_dump_ctl mdc;
INIT_LIST_HEAD(&vmas.h);
vmas.nr = 0;
vm_area_list_init(&vmas);
pr_info("========================================\n");
pr_info("Dumping task (pid: %d)\n", pid);

View File

@@ -705,12 +705,7 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list,
DIR *map_files_dir = NULL;
struct bfd f;
vma_area_list->nr = 0;
vma_area_list->nr_aios = 0;
vma_area_list->priv_longest = 0;
vma_area_list->priv_size = 0;
vma_area_list->shared_longest = 0;
INIT_LIST_HEAD(&vma_area_list->h);
vm_area_list_init(vma_area_list);
f.fd = open_proc(pid, "smaps");
if (f.fd < 0)