-
Andrey Vagin authored
In this case private vma-s will be inherited by children, it allows to restore copy-on-write reqions. This code compares child and parent vma lists. If it found two vma-s with the same start and end addresses, it decides that the child inherites this vmas from the parent. This code calculates a size of all private vma-s, then allocate a memory region for all vma-s and maps them one by one. If a vma is inherited it will be remaped to an allocated place. As a result all vma-s will be placed in a continious memory region and sorted by start addresses. This logic will be used for remap vma-s to correct address. v2: fix accoding with Pavel's comments ( clean up and simplify ) v3: simplify code and check that VMA-s are sorted Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
1a9d87de