2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-05 00:35:23 +00:00

crtools: move all stuff about vma together

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin
2013-11-05 12:33:03 +04:00
committed by Pavel Emelyanov
parent 824403a009
commit 0d1dfc2e08
17 changed files with 56 additions and 45 deletions

View File

@@ -111,34 +111,6 @@ struct cr_fdset *cr_glob_fdset_open(int mode);
void close_cr_fdset(struct cr_fdset **cr_fdset);
struct vm_area_list {
struct list_head h;
unsigned nr;
unsigned long priv_size; /* nr of pages in private VMAs */
unsigned long longest; /* nr of pages in longest VMA */
};
#define VM_AREA_LIST(name) struct vm_area_list name = { .h = LIST_HEAD_INIT(name.h), .nr = 0, }
int collect_mappings(pid_t pid, struct vm_area_list *vma_area_list);
void free_mappings(struct vm_area_list *vma_area_list);
bool privately_dump_vma(struct vma_area *vma);
struct vma_area {
struct list_head list;
VmaEntry vma;
union {
int vm_file_fd;
int vm_socket_id;
};
unsigned long *page_bitmap; /* existent pages */
unsigned long *ppage_bitmap; /* parent's existent pages */
};
#define vma_area_is(vma_area, s) vma_entry_is(&((vma_area)->vma), s)
#define vma_area_len(vma_area) vma_entry_len(&((vma_area)->vma))
struct fdt {
int nr; /* How many tasks share this fd table */
pid_t pid; /* Who should restore this fd table */
@@ -171,12 +143,6 @@ struct rst_info {
};
};
static inline int in_vma_area(struct vma_area *vma, unsigned long addr)
{
return addr >= (unsigned long)vma->vma.start &&
addr < (unsigned long)vma->vma.end;
}
/*
* When we have to restore a shared resource, we mush select which
* task should do it, and make other(s) wait for it. In order to