2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

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 <rppt@linux.vnet.ibm.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Mike Rapoport
2016-11-10 10:00:01 +02:00
committed by Pavel Emelyanov
parent c4f4e6c926
commit ab2247ce2d
2 changed files with 7 additions and 7 deletions

View File

@@ -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);

View File

@@ -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);
}