From ab2247ce2dfc5a2353d9e9ddd18c904475fe13f3 Mon Sep 17 00:00:00 2001 From: Mike Rapoport Date: Thu, 10 Nov 2016 10:00:01 +0200 Subject: [PATCH] criu: pagemap: use pid instead if id where appropriate 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. travis-ci: success for criu: pagemap: minor improvements Signed-off-by: Mike Rapoport Signed-off-by: Pavel Emelyanov --- 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 a4f8a8e9b..be4a99630 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 8f7b5513f..e8e39b151 100644 --- a/criu/pagemap.c +++ b/criu/pagemap.c @@ -408,7 +408,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; @@ -440,7 +440,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; @@ -449,7 +449,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; } @@ -478,7 +478,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); }