mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
vma: Add vma_next() helper
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
committed by
Andrei Vagin
parent
ef6c3f6ce6
commit
0c4eaafd4a
@@ -2226,7 +2226,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list,
|
||||
break;
|
||||
if (prev_vma_end < s_vma->e->end)
|
||||
prev_vma_end = s_vma->e->end;
|
||||
s_vma = list_entry(s_vma->list.next, struct vma_area, list);
|
||||
s_vma = vma_next(s_vma);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2239,7 +2239,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list,
|
||||
break;
|
||||
if (prev_vma_end < t_vma->e->end)
|
||||
prev_vma_end = t_vma->e->end;
|
||||
t_vma = list_entry(t_vma->list.next, struct vma_area, list);
|
||||
t_vma = vma_next(t_vma);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@@ -104,4 +104,9 @@ static inline bool vma_area_is_private(struct vma_area *vma,
|
||||
return vma_entry_is_private(vma->e, task_size);
|
||||
}
|
||||
|
||||
static inline struct vma_area *vma_next(struct vma_area *vma)
|
||||
{
|
||||
return list_entry(vma->list.next, struct vma_area, list);
|
||||
}
|
||||
|
||||
#endif /* __CR_VMA_H__ */
|
||||
|
@@ -724,7 +724,7 @@ static int restore_priv_vma_content(struct pstree_item *t)
|
||||
while (va >= vma->e->end) {
|
||||
if (vma->list.next == vmas)
|
||||
goto err_addr;
|
||||
vma = list_entry(vma->list.next, struct vma_area, list);
|
||||
vma = vma_next(vma);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user