[CRIU] [crtools-bot for Cyrill Gorcunov ] files: Move structures
and enums into the header
Cyrill Gorcunov
gorcunov at openvz.org
Tue Feb 28 10:13:47 EST 2012
The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
------>
commit 69fefa4d65d6c4f04c00da355d1a1620e1674462
Author: Cyrill Gorcunov <gorcunov at openvz.org>
Date: Wed Feb 22 13:46:36 2012 +0400
files: Move structures and enums into the header
Having them in the header file will allow to share these
structures with other callers. Moreover, this is a good
practice to have definition(s) in header file until otherwise
really needed.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
Acked-by: Pavel Emelyanov <xemul at parallels.com>
---
files.c | 31 -------------------------------
include/files.h | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/files.c b/files.c
index 207a6a0..7212c43 100644
--- a/files.c
+++ b/files.c
@@ -20,37 +20,6 @@
#include "util-net.h"
#include "lock.h"
-enum fdinfo_states {
- FD_STATE_PREP, /* Create unix sockets */
- FD_STATE_CREATE, /* Create and send fd */
- FD_STATE_RECV, /* Receive fd */
-
- FD_STATE_MAX
-};
-
-struct fmap_fd {
- struct fmap_fd *next;
- unsigned long start;
- int pid;
- int fd;
-};
-
-struct fdinfo_desc {
- char id[FD_ID_SIZE];
- u64 addr;
- int pid;
- u32 real_pid; /* futex */
- u32 users; /* futex */
- struct list_head list;
-};
-
-struct fdinfo_list_entry {
- struct list_head list;
- int fd;
- int pid;
- u32 real_pid;
-};
-
static struct fdinfo_desc *fdinfo_descs;
static int nr_fdinfo_descs;
diff --git a/include/files.h b/include/files.h
index b28d0f4..3b203be 100644
--- a/include/files.h
+++ b/include/files.h
@@ -1,6 +1,42 @@
#ifndef FILES_H_
#define FILES_H_
+#include "compiler.h"
+#include "types.h"
+#include "list.h"
+#include "image.h"
+
+enum fdinfo_states {
+ FD_STATE_PREP, /* Create unix sockets */
+ FD_STATE_CREATE, /* Create and send fd */
+ FD_STATE_RECV, /* Receive fd */
+
+ FD_STATE_MAX
+};
+
+struct fmap_fd {
+ struct fmap_fd *next;
+ unsigned long start;
+ int pid;
+ int fd;
+};
+
+struct fdinfo_desc {
+ char id[FD_ID_SIZE];
+ u64 addr;
+ int pid;
+ u32 real_pid; /* futex */
+ u32 users; /* futex */
+ struct list_head list;
+};
+
+struct fdinfo_list_entry {
+ struct list_head list;
+ int fd;
+ int pid;
+ u32 real_pid;
+};
+
extern int prepare_fds(int pid);
extern int prepare_fd_pid(int pid);
extern int prepare_fdinfo_global(void);
More information about the CRIU
mailing list