72332c
From 454fe3e7c07ba48a7a065135482196b53e376de0 Mon Sep 17 00:00:00 2001
72332c
From: Dmitry Safonov <dima@arista.com>
72332c
Date: Thu, 10 May 2018 19:14:42 +0100
72332c
Subject: [PATCH 2/8] parasite: Rename misnamed nr_pages
72332c
72332c
It's actually number of bytes spliced, not pages.
72332c
And I bet (unsigned long) suits the purpose more than (int).
72332c
72332c
Signed-off-by: Dmitry Safonov <dima@arista.com>
72332c
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
72332c
---
72332c
 criu/pie/parasite.c | 10 +++++-----
72332c
 1 file changed, 5 insertions(+), 5 deletions(-)
72332c
72332c
diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
72332c
index 7a48f324e..b9dae3f94 100644
72332c
--- a/criu/pie/parasite.c
72332c
+++ b/criu/pie/parasite.c
72332c
@@ -67,7 +67,8 @@ static int dump_pages(struct parasite_dump_pages_args *args)
72332c
 {
72332c
 	int p, ret, tsock;
72332c
 	struct iovec *iovs;
72332c
-	int off, nr_segs, nr_pages;
72332c
+	int off, nr_segs;
72332c
+	unsigned long spliced_bytes = 0;
72332c
 
72332c
 	tsock = parasite_get_rpc_sock();
72332c
 	p = recv_fd(tsock);
72332c
@@ -75,7 +76,6 @@ static int dump_pages(struct parasite_dump_pages_args *args)
72332c
 		return -1;
72332c
 
72332c
 	iovs = pargs_iovs(args);
72332c
-	nr_pages = 0;
72332c
 	off = 0;
72332c
 	nr_segs = args->nr_segs;
72332c
 	if (nr_segs > UIO_MAXIOV)
72332c
@@ -89,16 +89,16 @@ static int dump_pages(struct parasite_dump_pages_args *args)
72332c
 						ret, nr_segs, args->off + off);
72332c
 			return -1;
72332c
 		}
72332c
-		nr_pages += ret;
72332c
+		spliced_bytes += ret;
72332c
 		off += nr_segs;
72332c
 		if (off == args->nr_segs)
72332c
 			break;
72332c
 		if (off + nr_segs > args->nr_segs)
72332c
 			nr_segs = args->nr_segs - off;
72332c
 	}
72332c
-	if (nr_pages != args->nr_pages * PAGE_SIZE) {
72332c
+	if (spliced_bytes != args->nr_pages * PAGE_SIZE) {
72332c
 		sys_close(p);
72332c
-		pr_err("Can't splice all pages to pipe (%d/%d)\n", nr_pages, args->nr_pages);
72332c
+		pr_err("Can't splice all pages to pipe (%lu/%d)\n", spliced_bytes, args->nr_pages);
72332c
 		return -1;
72332c
 	}
72332c
 
72332c
-- 
72332c
2.17.0
72332c