mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-28 12:57:57 +00:00
shmem: Move pr_info to open_fd_of_real_pid()
Just to not allocate path buffer twice. v2: Change debug message. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
02fcb99c39
commit
320dba091a
@ -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);
|
||||
|
@ -1411,6 +1411,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 /proc/%s on the criu side\n", path);
|
||||
if (flags == O_RDONLY)
|
||||
ret = userns_call(fn_open_proc_r, UNS_FDOUT, path, ret + 1, -1);
|
||||
else if (flags == O_WRONLY)
|
||||
|
Loading…
x
Reference in New Issue
Block a user