[CRIU] [PATCH 1/2] criu: pagemap: use pid instead if id where appropriate

Mike Rapoport rppt at linux.vnet.ibm.com
Thu Nov 10 00:00:01 PST 2016


Some pagemap methods mix up using PIDs and pagemap internal ids. Using the
'pid' name in places that actually refer to PIDs makes the code clearer.

Signed-off-by: Mike Rapoport <rppt at linux.vnet.ibm.com>
---
 criu/include/pagemap.h |  4 ++--
 criu/pagemap.c         | 10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/criu/include/pagemap.h b/criu/include/pagemap.h
index 705a9af..39227f2 100644
--- a/criu/include/pagemap.h
+++ b/criu/include/pagemap.h
@@ -85,8 +85,8 @@ struct page_read {
  *  0 -- no images
  *  1 -- opened
  */
-extern int open_page_read(int id, struct page_read *, int pr_flags);
-extern int open_page_read_at(int dfd, int id, struct page_read *pr,
+extern int open_page_read(int pid, struct page_read *, int pr_flags);
+extern int open_page_read_at(int dfd, int pid, struct page_read *pr,
 		int pr_flags);
 extern void pagemap2iovec(PagemapEntry *pe, struct iovec *iov);
 extern void iovec2pagemap(struct iovec *iov, PagemapEntry *pe);
diff --git a/criu/pagemap.c b/criu/pagemap.c
index 105ad59..8dd2e2f 100644
--- a/criu/pagemap.c
+++ b/criu/pagemap.c
@@ -438,7 +438,7 @@ free_pagemaps:
 	return -1;
 }
 
-int open_page_read_at(int dfd, int id, struct page_read *pr, int pr_flags)
+int open_page_read_at(int dfd, int pid, struct page_read *pr, int pr_flags)
 {
 	int flags, i_typ;
 	static unsigned ids = 1;
@@ -470,7 +470,7 @@ int open_page_read_at(int dfd, int id, struct page_read *pr, int pr_flags)
 	pr->bunch.iov_base = NULL;
 	pr->pmes = NULL;
 
-	pr->pmi = open_image_at(dfd, i_typ, O_RSTR, (long)id);
+	pr->pmi = open_image_at(dfd, i_typ, O_RSTR, (long)pid);
 	if (!pr->pmi)
 		return -1;
 
@@ -479,7 +479,7 @@ int open_page_read_at(int dfd, int id, struct page_read *pr, int pr_flags)
 		return 0;
 	}
 
-	if (try_open_parent(dfd, id, pr, pr_flags)) {
+	if (try_open_parent(dfd, pid, pr, pr_flags)) {
 		close_image(pr->pmi);
 		return -1;
 	}
@@ -509,7 +509,7 @@ int open_page_read_at(int dfd, int id, struct page_read *pr, int pr_flags)
 	return 1;
 }
 
-int open_page_read(int id, struct page_read *pr, int pr_flags)
+int open_page_read(int pid, struct page_read *pr, int pr_flags)
 {
-	return open_page_read_at(get_service_fd(IMG_FD_OFF), id, pr, pr_flags);
+	return open_page_read_at(get_service_fd(IMG_FD_OFF), pid, pr, pr_flags);
 }
-- 
1.9.1



More information about the CRIU mailing list