[CRIU] [PATCH 6/9] files: Outline collect_used_fd() from header
Pavel Emelyanov
xemul at virtuozzo.com
Fri Oct 21 05:51:11 PDT 2016
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/files.c | 12 ++++++++++++
criu/include/files.h | 12 +-----------
2 files changed, 13 insertions(+), 11 deletions(-)
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)
{
--
2.1.4
More information about the CRIU
mailing list