[CRIU] [PATCH 15/28] files: Move fle_init() to files.c

Kirill Tkhai ktkhai at virtuozzo.com
Mon Jun 5 20:25:38 MSK 2017


It has only one user. Also, in next patches will be
used pstree_item_by_virt() function, and I don't
want to add "#include" to "files.h" for it, and to
nest headers.

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/files.c         |    8 ++++++++
 criu/include/files.h |    8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/criu/files.c b/criu/files.c
index 6aa88ba8b..6d21b9e1f 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -685,6 +685,14 @@ int rst_file_params(int fd, FownEntry *fown, int flags)
 	return 0;
 }
 
+static void fle_init(struct fdinfo_list_entry *fle, int pid, FdinfoEntry *fe)
+{
+	fle->pid = pid;
+	fle->fe = fe;
+	fle->received = 0;
+	fle->stage = FLE_INITIALIZED;
+}
+
 int collect_fd(int pid, FdinfoEntry *e, struct rst_info *rst_info)
 {
 	struct fdinfo_list_entry *le, *new_le;
diff --git a/criu/include/files.h b/criu/include/files.h
index 9cb4aef26..ef351b7e2 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -80,14 +80,6 @@ struct fdinfo_list_entry {
 	u8			stage:3;
 };
 
-static inline void fle_init(struct fdinfo_list_entry *fle, int pid, FdinfoEntry *fe)
-{
-	fle->pid = pid;
-	fle->fe = fe;
-	fle->received = 0;
-	fle->stage = FLE_INITIALIZED;
-}
-
 /* reports whether fd_a takes prio over fd_b */
 static inline int fdinfo_rst_prio(struct fdinfo_list_entry *fd_a, struct fdinfo_list_entry *fd_b)
 {



More information about the CRIU mailing list