[CRIU] [PATCH 09/16] dump: hide inode number into fd_parms structure

Kinsbursky Stanislav skinsbursky at openvz.org
Thu Mar 1 12:57:16 EST 2012



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 01015e3..c6bf919 100644
--- a/cr-dump.c
+++ b/cr-dump.c
@@ -91,6 +91,7 @@ struct fd_parms {
 	unsigned long	pos;
 	unsigned int	flags;
 	unsigned int	type;
+	ino_t		ino;
 
 	u64		id;
 	pid_t		pid;
@@ -247,8 +248,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;
@@ -264,10 +264,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) {
@@ -281,7 +281,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;
 }
@@ -309,6 +309,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->ino	= fd_stat->st_ino;
 	p->type = 0;
 	if (S_ISREG(fd_stat->st_mode) || S_ISCHR(fd_stat->st_mode)) {
 		p->id = MAKE_FD_GENID(fd_stat->st_dev, fd_stat->st_ino, p->pos);
@@ -363,7 +364,7 @@ static int dump_one_fd(pid_t pid, char *d_name, struct cr_fdset *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