mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +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:
committed by
Andrei Vagin
parent
6e86b9eb01
commit
32e9f15525
@@ -108,8 +108,7 @@ void free_mappings(struct vm_area_list *vma_area_list)
|
|||||||
free(vma_area);
|
free(vma_area);
|
||||||
}
|
}
|
||||||
|
|
||||||
INIT_LIST_HEAD(&vma_area_list->h);
|
vm_area_list_init(vma_area_list);
|
||||||
vma_area_list->nr = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int collect_mappings(pid_t pid, struct vm_area_list *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 parasite_dump_misc misc;
|
||||||
struct mem_dump_ctl mdc;
|
struct mem_dump_ctl mdc;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&vmas.h);
|
vm_area_list_init(&vmas);
|
||||||
vmas.nr = 0;
|
|
||||||
|
|
||||||
pr_info("========================================\n");
|
pr_info("========================================\n");
|
||||||
pr_info("Pre-dumping task (pid: %d)\n", pid);
|
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 proc_posix_timers_stat proc_args;
|
||||||
struct mem_dump_ctl mdc;
|
struct mem_dump_ctl mdc;
|
||||||
|
|
||||||
INIT_LIST_HEAD(&vmas.h);
|
vm_area_list_init(&vmas);
|
||||||
vmas.nr = 0;
|
|
||||||
|
|
||||||
pr_info("========================================\n");
|
pr_info("========================================\n");
|
||||||
pr_info("Dumping task (pid: %d)\n", pid);
|
pr_info("Dumping task (pid: %d)\n", pid);
|
||||||
|
@@ -705,12 +705,7 @@ int parse_smaps(pid_t pid, struct vm_area_list *vma_area_list,
|
|||||||
DIR *map_files_dir = NULL;
|
DIR *map_files_dir = NULL;
|
||||||
struct bfd f;
|
struct bfd f;
|
||||||
|
|
||||||
vma_area_list->nr = 0;
|
vm_area_list_init(vma_area_list);
|
||||||
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);
|
|
||||||
|
|
||||||
f.fd = open_proc(pid, "smaps");
|
f.fd = open_proc(pid, "smaps");
|
||||||
if (f.fd < 0)
|
if (f.fd < 0)
|
||||||
|
Reference in New Issue
Block a user