Commit 904e7b38 authored by Pavel Emelyanov's avatar Pavel Emelyanov

file: Introduce prepare_files()

I'm about to merge all the file images into one big image,
so here's the place that would read it and collect.
Reviewed-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent b7b3b19f
......@@ -222,7 +222,7 @@ static int restore_finish_ns_stage(int from, int to)
static int crtools_prepare_shared(void)
{
if (prepare_shared_fdinfo())
if (prepare_files())
return -1;
/* We might want to remove ghost files on failed restore */
......
......@@ -54,14 +54,12 @@
#define FDESC_HASH_SIZE 64
static struct hlist_head file_desc_hash[FDESC_HASH_SIZE];
int prepare_shared_fdinfo(void)
static void init_fdesc_hash(void)
{
int i;
for (i = 0; i < FDESC_HASH_SIZE; i++)
INIT_HLIST_HEAD(&file_desc_hash[i]);
return 0;
}
void file_desc_init(struct file_desc *d, u32 id, struct file_desc_ops *ops)
......@@ -1665,3 +1663,9 @@ int open_transport_socket(void)
return 0;
}
int prepare_files(void)
{
init_fdesc_hash();
return 0;
}
......@@ -157,7 +157,7 @@ extern void show_saved_files(void);
extern int prepare_fds(struct pstree_item *me);
extern int prepare_fd_pid(struct pstree_item *me);
extern int prepare_ctl_tty(int pid, struct rst_info *rst_info, u32 ctl_tty_id);
extern int prepare_shared_fdinfo(void);
extern int prepare_files(void);
extern int restore_fs(struct pstree_item *);
extern int prepare_fs_pid(struct pstree_item *);
extern int set_fd_flags(int fd, int flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment