[6/9] files: Outline collect_used_fd() from header

Submitted by Pavel Emelianov on Oct. 21, 2016, 12:51 p.m.

Details

Message ID 580A0F3F.2050404@virtuozzo.com
State Superseded
Series "headers: Sanitize headers"
Headers show

Commit Message

Pavel Emelianov Oct. 21, 2016, 12:51 p.m.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/files.c         | 12 ++++++++++++
 criu/include/files.h | 12 +-----------
 2 files changed, 13 insertions(+), 11 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/files.c b/criu/files.c
index 37771a3..64f7c16 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -111,6 +111,18 @@  struct fdinfo_list_entry *find_used_fd(struct list_head *head, int fd)
 	return NULL;
 }
 
+void collect_used_fd(struct fdinfo_list_entry *new_fle, struct rst_info *ri)
+{
+	struct fdinfo_list_entry *fle;
+
+	list_for_each_entry(fle, &ri->used, used_list) {
+		if (new_fle->fe->fd < fle->fe->fd)
+			break;
+	}
+
+	list_add_tail(&new_fle->used_list, &fle->used_list);
+}
+
 unsigned int find_unused_fd(struct list_head *head, int hint_fd)
 {
 	struct fdinfo_list_entry *fle;
diff --git a/criu/include/files.h b/criu/include/files.h
index b8f670a..4890da1 100644
--- a/criu/include/files.h
+++ b/criu/include/files.h
@@ -109,17 +109,7 @@  struct file_desc_ops {
 	char *			(*name)(struct file_desc *, char *b, size_t s);
 };
 
-static inline void collect_used_fd(struct fdinfo_list_entry *new_fle, struct rst_info *ri)
-{
-	struct fdinfo_list_entry *fle;
-
-	list_for_each_entry(fle, &ri->used, used_list) {
-		if (new_fle->fe->fd < fle->fe->fd)
-			break;
-	}
-
-	list_add_tail(&new_fle->used_list, &fle->used_list);
-}
+extern void collect_used_fd(struct fdinfo_list_entry *new_fle, struct rst_info *ri);
 
 static inline void collect_gen_fd(struct fdinfo_list_entry *fle, struct rst_info *ri)
 {