[CRIU] [PATCH v3 2/8] dump: hide inode number into fd_parms
structure
Kinsbursky Stanislav
skinsbursky at openvz.org
Mon Mar 5 13:00:50 EST 2012
This i s a cleanup patch - it hides ideno number into fd params. This allows
to unify dump_one* calls.
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
cr-dump.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/cr-dump.c b/cr-dump.c
index 87c9f2e..718685e 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -92,6 +92,7 @@ struct fd_parms {
unsigned long pos;
unsigned int flags;
unsigned int type;
+ ino_t ino;
u64 id;
pid_t pid;
@@ -248,8 +249,7 @@ err:
return ret;
}
-static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd,
- struct cr_fdset *cr_fdset)
+static int dump_one_pipe(struct fd_parms *p, int lfd, struct cr_fdset *cr_fdset)
{
struct pipe_entry e;
int ret = -1;
@@ -265,10 +265,10 @@ static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd,
return -1;
}
- pr_info("Dumping pipe %ld/%x flags %x\n", p->fd_name, id, p->flags);
+ pr_info("Dumping pipe %ld/%lx flags %x\n", p->fd_name, p->ino, p->flags);
e.fd = p->fd_name;
- e.pipeid = id;
+ e.pipeid = p->ino;
e.flags = p->flags;
if (p->flags & O_WRONLY) {
@@ -282,7 +282,7 @@ err:
pr_info("Dumped pipe: fd: %8x pipeid: %8x flags: %8x bytes: %8x\n",
e.fd, e.pipeid, e.flags, e.bytes);
else
- pr_err("Dumping pipe %ld/%x flags %x\n", p->fd_name, id, p->flags);
+ pr_err("Dumping pipe %ld/%lx flags %x\n", p->fd_name, p->ino, p->flags);
return ret;
}
@@ -311,6 +311,7 @@ static int read_fd_params(pid_t pid, char *fd, struct stat *fd_stat, struct fd_p
p->pid = pid;
p->id = FD_ID_INVALID;
p->type = 0;
+ p->ino = fd_stat->st_ino;
switch (fd_stat->st_mode & S_IFMT) {
case S_IFREG:
@@ -367,7 +368,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, char *d_name, struct cr_fdset
return dump_one_reg_file(&p, lfd, cr_fdset, 1);
if (S_ISFIFO(fd_stat.st_mode))
- return dump_one_pipe(&p, fd_stat.st_ino, lfd, cr_fdset);
+ return dump_one_pipe(&p, lfd, cr_fdset);
err:
pr_err("Can't dump file %ld of that type [%x]\n", p.fd_name, fd_stat.st_mode);
More information about the CRIU
mailing list