Commit 499cc678 authored by Pavel Emelyanov's avatar Pavel Emelyanov

pipe: Remove ID arg from pipe data dump fn

This routine checks for pipe data being dumped based on pipe ID, but the arg in questoin
is the pipe's end ID which makes code reading confusing.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent e23c9e0c
......@@ -58,7 +58,7 @@ static int dump_one_fifo(int lfd, u32 id, const struct fd_parms *p)
if (write_img(img, &e) < 0)
return -1;
return dump_one_pipe_data(CR_FD_FIFO_DATA, lfd, id, p);
return dump_one_pipe_data(CR_FD_FIFO_DATA, lfd, p);
}
static const struct fdtype_ops fifo_ops = {
......
......@@ -5,7 +5,7 @@ extern void mark_pipe_master(void);
int dump_pipe(struct fd_parms *p, int lfd,
const struct cr_fdset *cr_fdset);
extern int dump_one_pipe_data(int img_type, int lfd, u32 id, const struct fd_parms *p);
extern int dump_one_pipe_data(int img_type, int lfd, const struct fd_parms *p);
extern int restore_pipe_data(int img_type, int pfd, u32 id, int bytes, off_t off);
#endif
......@@ -301,7 +301,7 @@ int collect_pipes(void)
static u32 pipes_with_data[1024]; /* pipes for which data already dumped */
static int nr_pipes;
int dump_one_pipe_data(int img_type, int lfd, u32 id, const struct fd_parms *p)
int dump_one_pipe_data(int img_type, int lfd, const struct fd_parms *p)
{
int img = fdset_fd(glob_fdset, img_type);
int pipe_size, i, bytes;
......@@ -317,7 +317,7 @@ int dump_one_pipe_data(int img_type, int lfd, u32 id, const struct fd_parms *p)
return 0;
}
pr_info("Dumping data from pipe %#x fd %d\n", id, lfd);
pr_info("Dumping data from pipe %#x fd %d\n", (u32)p->stat.st_ino, lfd);
if (ARRAY_SIZE(pipes_with_data) < nr_pipes + 1) {
pr_err("OOM storing pipe\n");
......@@ -372,7 +372,8 @@ int dump_one_pipe_data(int img_type, int lfd, u32 id, const struct fd_parms *p)
pr_perror("Can't push pipe data");
goto err_close;
} else if (wrote != bytes) {
pr_err("%#x: Wanted to write %d bytes, but wrote %d\n", id, bytes, wrote);
pr_err("%#x: Wanted to write %d bytes, but wrote %d\n",
(u32)p->stat.st_ino, bytes, wrote);
goto err_close;
}
} else if (bytes < 0) {
......@@ -406,7 +407,7 @@ static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p)
if (write_img(fdset_fd(glob_fdset, CR_FD_PIPES), &pe))
return -1;
return dump_one_pipe_data(CR_FD_PIPES_DATA, lfd, id, p);
return dump_one_pipe_data(CR_FD_PIPES_DATA, lfd, p);
}
static const struct fdtype_ops pipe_ops = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment