[CRIU] [PATCH 20/28] rst: obsolete functions removed

Kinsbursky Stanislav skinsbursky at openvz.org
Thu Mar 22 13:59:45 EDT 2012


From: Stanislav Kinsbursky <skinsbursky at openvz.org>

Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
 files.c |   74 ---------------------------------------------------------------
 1 files changed, 0 insertions(+), 74 deletions(-)
-------------- next part --------------
diff --git a/files.c b/files.c
index 94ebdfe..4bc9f08 100644
--- a/files.c
+++ b/files.c
@@ -32,18 +32,6 @@ struct file_recipient {
 	u32			ready;
 };
 
-static int get_file_path(char *path, struct fdinfo_entry *fe, int fd)
-{
-	if (read(fd, path, fe->len) != fe->len) {
-		pr_perror("Error reading path");
-		return -1;
-	}
-
-	path[fe->len] = '\0';
-
-	return 0;
-}
-
 static int collect_fd_pid(int pid, struct fd_entry *fde)
 {
 	struct file_info *fi;
@@ -177,25 +165,6 @@ int prepare_fd_pid(int pid)
 	return ret;
 }
 
-static int open_fe_fd(struct fdinfo_entry *fe, int fd)
-{
-	char path[PATH_MAX];
-	int tmp;
-
-	if (get_file_path(path, fe, fd))
-		return -1;
-
-	tmp = open(path, fe->flags);
-	if (tmp < 0) {
-		pr_perror("Can't open file %s", path);
-		return -1;
-	}
-
-	lseek(tmp, fe->pos, SEEK_SET);
-
-	return tmp;
-}
-
 static int restore_cwd(int id)
 {
 	struct file_info *fi;
@@ -368,33 +337,6 @@ static int open_fd_transport(int pid, struct file_info *fi, struct fd_entry *fde
 	return open_transport(pid, fde->fd, fi);
 }
 
-static int open_fmap(int pid, struct fdinfo_entry *fe, int fd)
-{
-	struct fmap_fd *new;
-	int tmp;
-
-	tmp = open_fe_fd(fe, fd);
-	if (tmp < 0)
-		return -1;
-
-	pr_info("%d:\t\tWill map %lx to %d\n", pid, (unsigned long)fe->addr, tmp);
-
-	new = xmalloc(sizeof(*new));
-	if (!new) {
-		close_safe(&tmp);
-		return -1;
-	}
-
-	new->start	= fe->addr;
-	new->fd		= tmp;
-	new->next	= fmap_fds;
-	new->pid	= pid;
-
-	fmap_fds	= new;
-
-	return 0;
-}
-
 static int collect_fmap(int pid, struct fdinfo_entry *fe, int fd)
 {
 	struct fmap_fd *new;
@@ -450,22 +392,6 @@ static int open_fdinfo(int pid, struct fd_entry *fde, int *fdinfo_fd, int state)
 	return ret;
 }
 
-static int open_special_fdinfo(int pid, struct fdinfo_entry *fe,
-		int fdinfo_fd, int state)
-{
-	if (state != FD_STATE_RECV) {
-		lseek(fdinfo_fd, fe->len, SEEK_CUR);
-		return 0;
-	}
-
-	if (fe->fde.type == FDINFO_MAP)
-		return open_fmap(pid, fe, fdinfo_fd);
-
-	pr_info("%d: fe->type: %d\n", pid,  fe->fde.type);
-	BUG_ON(1);
-	return -1;
-}
-
 int prepare_fds(int pid)
 {
 	int ret, err = -1, fdinfo_fd, state, cwd_id = 0;


More information about the CRIU mailing list