[CRIU] [PATCH 06/28] shmem: Move pr_info to open_fd_of_real_pid()
Kirill Tkhai
ktkhai at virtuozzo.com
Mon Jun 5 20:24:19 MSK 2017
Just to not allocate path buffer twice.
Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
criu/shmem.c | 5 -----
criu/util.c | 1 +
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/criu/shmem.c b/criu/shmem.c
index fbfba0060..2af8f8802 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -441,16 +441,11 @@ int collect_shmem(int pid, struct vma_area *vma)
static int shmem_wait_and_open(struct shmem_info *si, VmaEntry *vi)
{
- char path[128];
int pid, ret;
pr_info("Waiting for the %lx shmem to appear\n", si->shmid);
futex_wait_while(&si->lock, 0);
- snprintf(path, sizeof(path), "/proc/%d/fd/%d",
- si->pid, si->fd);
-
- pr_info("Opening shmem [%s] \n", path);
pid = pstree_pid_by_virt(si->pid)->real;
ret = open_fd_of_real_pid(pid, si->fd, O_RDWR);
futex_inc_and_wake(&si->lock);
diff --git a/criu/util.c b/criu/util.c
index 99119c1c3..7ff40e2f8 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -1234,6 +1234,7 @@ int open_fd_of_real_pid(pid_t pid, int fd, int flags)
int ret;
ret = sprintf(path, "%d/fd/%d", pid, fd);
+ pr_info("Opening real [%s]\n", path);
if (flags == O_RDONLY)
ret = userns_call(fn_open_proc_r, UNS_FDOUT, path, ret + 1, -1);
else if (flags == O_WRONLY)
More information about the CRIU
mailing list