2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

files: Use open_reg_by_id helper where appropriate

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-04-09 15:57:05 +04:00
parent 447f369ba9
commit f560ddea55

21
files.c
View File

@@ -501,7 +501,6 @@ int prepare_fs(int pid)
{
int ifd, cwd;
struct fs_entry fe;
struct file_desc *fd;
ifd = open_image_ro(CR_FD_FS, pid);
if (ifd < 0)
@@ -510,14 +509,7 @@ int prepare_fs(int pid)
if (read_img(ifd, &fe) < 0)
return -1;
fd = find_file_desc_raw(FDINFO_REG, fe.cwd_id);
if (fd == NULL) {
pr_err("Can't find file for %d's cwd (%x)\n",
pid, fe.cwd_id);
return -1;
}
cwd = open_fe_fd(fd);
cwd = open_reg_by_id(fe.cwd_id);
if (cwd < 0)
return -1;
@@ -543,14 +535,5 @@ int prepare_fs(int pid)
int get_filemap_fd(int pid, struct vma_entry *vma_entry)
{
struct file_desc *fd;
fd = find_file_desc_raw(FDINFO_REG, vma_entry->shmid);
if (fd == NULL) {
pr_err("Can't find file for mapping %lx-%lx\n",
vma_entry->start, vma_entry->end);
return -1;
}
return open_fe_fd(fd);
return open_reg_by_id(vma_entry->shmid);
}