[CRIU] [PATCH] restore: Drop redundant @pvma argument

Cyrill Gorcunov gorcunov at openvz.org
Fri Apr 12 09:46:36 EDT 2013


Leftover from development stage.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---

Andrew, do I miss something obvious and this argument
has some important meaning?

 cr-restore.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/cr-restore.c b/cr-restore.c
index e26a06c..9bdeade 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -189,13 +189,13 @@ err:
 }
 
 /* Map a private vma, if it is not mapped by a parrent yet */
-static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
-			struct vma_area **pvma, struct list_head *pvma_list)
+static int map_private_vma(pid_t pid, struct vma_area *vma,
+			   void *tgt_addr, struct list_head *pvma_list)
 {
 	int ret;
 	void *addr, *paddr = NULL;
 	unsigned long nr_pages;
-	struct vma_area *p = *pvma;
+	struct vma_area *p;
 
 	if (vma_entry_is(&vma->vma, VMA_FILE_PRIVATE)) {
 		ret = get_filemap_fd(pid, &vma->vma);
@@ -213,7 +213,7 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
 	if (vma->page_bitmap == NULL)
 		return -1;
 
-	list_for_each_entry_continue(p, pvma_list, list) {
+	list_for_each_entry(p, pvma_list, list) {
 		if (p->vma.start > vma->vma.start)
 			 break;
 
@@ -227,8 +227,6 @@ static int map_private_vma(pid_t pid, struct vma_area *vma, void *tgt_addr,
 
 	}
 
-	*pvma = p;
-
 	if (paddr == NULL) {
 		pr_info("Map 0x%016"PRIx64"-0x%016"PRIx64" 0x%016"PRIx64" vma\n",
 			vma->vma.start, vma->vma.end, vma->vma.pgoff);
@@ -417,7 +415,7 @@ static int read_vmas(int pid)
 {
 	int fd, ret = 0;
 	LIST_HEAD(old);
-	struct vma_area *pvma, *vma;
+	struct vma_area *vma;
 	unsigned long priv_size = 0;
 	void *addr;
 
@@ -484,8 +482,6 @@ static int read_vmas(int pid)
 	current->rst->premmapped_addr = addr;
 	current->rst->premmapped_len = priv_size;
 
-	pvma = list_entry(&old, struct vma_area, list);
-
 	list_for_each_entry(vma, &rst_vmas.vma_list, list) {
 		if (pstart > vma->vma.start) {
 			ret = -1;
@@ -497,7 +493,7 @@ static int read_vmas(int pid)
 		if (!vma_priv(&vma->vma))
 			continue;
 
-		ret = map_private_vma(pid, vma, addr, &pvma, &old);
+		ret = map_private_vma(pid, vma, addr, &old);
 		if (ret < 0)
 			break;
 
-- 
1.8.1.4



More information about the CRIU mailing list