Commit 0c4eaafd authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by Andrei Vagin

vma: Add vma_next() helper

Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent ef6c3f6c
...@@ -2226,7 +2226,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list, ...@@ -2226,7 +2226,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list,
break; break;
if (prev_vma_end < s_vma->e->end) if (prev_vma_end < s_vma->e->end)
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; continue;
} }
...@@ -2239,7 +2239,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list, ...@@ -2239,7 +2239,7 @@ static long restorer_get_vma_hint(struct list_head *tgt_vma_list,
break; break;
if (prev_vma_end < t_vma->e->end) if (prev_vma_end < t_vma->e->end)
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; continue;
} }
......
...@@ -104,4 +104,9 @@ static inline bool vma_area_is_private(struct vma_area *vma, ...@@ -104,4 +104,9 @@ static inline bool vma_area_is_private(struct vma_area *vma,
return vma_entry_is_private(vma->e, task_size); 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__ */ #endif /* __CR_VMA_H__ */
...@@ -724,7 +724,7 @@ static int restore_priv_vma_content(struct pstree_item *t) ...@@ -724,7 +724,7 @@ static int restore_priv_vma_content(struct pstree_item *t)
while (va >= vma->e->end) { while (va >= vma->e->end) {
if (vma->list.next == vmas) if (vma->list.next == vmas)
goto err_addr; goto err_addr;
vma = list_entry(vma->list.next, struct vma_area, list); vma = vma_next(vma);
} }
/* /*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment