[CRIU] [PATCH 03/10] headers: Remove some dead code

Pavel Emelyanov xemul at virtuozzo.com
Fri May 20 09:52:57 PDT 2016


Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/include/restorer.h | 18 ++----------------
 criu/include/util.h     |  4 ----
 criu/util.c             | 15 ---------------
 3 files changed, 2 insertions(+), 35 deletions(-)

diff --git a/criu/include/restorer.h b/criu/include/restorer.h
index bce2f27..8c3923d 100644
--- a/criu/include/restorer.h
+++ b/criu/include/restorer.h
@@ -23,20 +23,6 @@
 #include <time.h>
 
 #include "images/mm.pb-c.h"
-#include "images/vma.pb-c.h"
-#include "images/creds.pb-c.h"
-#include "images/core.pb-c.h"
-
-struct task_restore_core_args;
-struct thread_restore_args;
-
-typedef long (*task_restore_fcall_t) (struct task_restore_core_args *args);
-typedef long (*thread_restore_fcall_t) (struct thread_restore_args *args);
-
-#define RESTORE_CMD__NONE		0
-#define RESTORE_CMD__GET_SELF_LEN	1
-#define RESTORE_CMD__RESTORE_CORE	2
-#define RESTORE_CMD__RESTORE_THREAD	3
 
 /*
  * These *must* be power of two values.
@@ -63,8 +49,6 @@ struct restore_posix_timer {
 	int overrun;
 };
 
-struct task_restore_core_args;
-
 /*
  * We should be able to construct fpu sigframe in sigreturn_prep_fpu_frame,
  * so the mem_zone.rt_sigframe should be 64-bytes aligned. To make things
@@ -116,6 +100,8 @@ struct thread_restore_args {
 	struct thread_creds_args	*creds_args;
 } __aligned(64);
 
+typedef long (*thread_restore_fcall_t) (struct thread_restore_args *args);
+
 struct task_restore_args {
 	struct thread_restore_args	*t;			/* thread group leader */
 
diff --git a/criu/include/util.h b/criu/include/util.h
index 3a1a092..38170b7 100644
--- a/criu/include/util.h
+++ b/criu/include/util.h
@@ -129,9 +129,6 @@ extern int do_open_proc(pid_t pid, int flags, const char *fmt, ...);
 		__f;							\
 	 })
 
-#define pr_img_head(type, ...)	pr_msg("\n"#type __VA_ARGS__ "\n----------------\n")
-#define pr_img_tail(type)	pr_msg("----------------\n")
-
 #define DEVZERO		(makedev(1, 5))
 
 #define KDEV_MINORBITS	20
@@ -264,7 +261,6 @@ FILE *fopenat(int dirfd, char *path, char *cflags);
 void split(char *str, char token, char ***out, int *n);
 
 int fd_has_data(int lfd);
-size_t read_into_buffer(int fd, char *buff, size_t size);
 
 int make_yard(char *path);
 
diff --git a/criu/util.c b/criu/util.c
index 7a6e42a..f518847 100644
--- a/criu/util.c
+++ b/criu/util.c
@@ -931,21 +931,6 @@ int fd_has_data(int lfd)
 	return ret;
 }
 
-size_t read_into_buffer(int fd, char *buff, size_t size)
-{
-	size_t n = 0;
-	size_t curr = 0;
-
-	while (1) {
-		n  = read(fd, buff + curr, size - curr);
-		if (n < 1)
-			return n;
-		curr += n;
-		if (curr == size)
-			return size;
-	}
-}
-
 int make_yard(char *path)
 {
 	if (mount("none", path, "tmpfs", 0, NULL)) {
-- 
2.5.0



More information about the CRIU mailing list