2012-12-24 15:36:14 +04:00
|
|
|
#ifndef __CR_FILES_REG_H__
|
|
|
|
#define __CR_FILES_REG_H__
|
2012-06-20 20:00:30 +04:00
|
|
|
|
2013-01-09 17:02:47 +04:00
|
|
|
#include "asm/types.h"
|
2012-06-26 02:36:13 +04:00
|
|
|
#include "files.h"
|
|
|
|
#include "image.h"
|
2012-06-20 20:00:30 +04:00
|
|
|
|
2013-02-15 17:33:06 +04:00
|
|
|
#include "protobuf/regfile.pb-c.h"
|
|
|
|
#include "protobuf/ghost-file.pb-c.h"
|
2012-07-17 07:17:02 +04:00
|
|
|
|
2012-06-20 20:00:30 +04:00
|
|
|
struct cr_fdset;
|
|
|
|
struct fd_parms;
|
|
|
|
|
2012-12-06 11:10:10 +04:00
|
|
|
struct file_remap {
|
|
|
|
char *path;
|
2014-07-03 19:06:58 +04:00
|
|
|
bool is_dir;
|
2014-08-06 15:51:57 +04:00
|
|
|
int mnt_id;
|
2012-12-06 11:10:10 +04:00
|
|
|
unsigned int users;
|
|
|
|
};
|
|
|
|
|
2012-06-26 02:36:13 +04:00
|
|
|
struct reg_file_info {
|
|
|
|
struct file_desc d;
|
2012-07-17 07:17:02 +04:00
|
|
|
RegFileEntry *rfe;
|
2012-09-26 06:20:06 +04:00
|
|
|
struct file_remap *remap;
|
2014-06-24 23:38:48 +04:00
|
|
|
bool size_checked;
|
2012-06-26 02:36:13 +04:00
|
|
|
char *path;
|
|
|
|
};
|
|
|
|
|
2012-06-20 20:00:30 +04:00
|
|
|
extern int open_reg_by_id(u32 id);
|
2014-07-03 19:07:58 +04:00
|
|
|
extern int open_reg_fd(struct file_desc *);
|
2014-06-06 12:20:02 +04:00
|
|
|
extern int open_path(struct file_desc *, int (*open_cb)(int ns_root_fd,
|
|
|
|
struct reg_file_info *, void *), void *arg);
|
2012-06-20 20:00:30 +04:00
|
|
|
extern void clear_ghost_files(void);
|
|
|
|
|
2012-09-17 20:12:58 +04:00
|
|
|
extern int prepare_shared_reg_files(void);
|
|
|
|
|
2013-06-14 00:11:08 +04:00
|
|
|
extern const struct fdtype_ops regfile_dump_ops;
|
2012-06-20 20:00:30 +04:00
|
|
|
extern int dump_one_reg_file(int lfd, u32 id, const struct fd_parms *p);
|
|
|
|
|
2012-12-06 11:10:14 +04:00
|
|
|
extern struct file_remap *lookup_ghost_remap(u32 dev, u32 ino);
|
|
|
|
extern void remap_put(struct file_remap *remap);
|
2014-02-07 13:51:29 +04:00
|
|
|
extern struct file_desc *collect_special_file(u32 id);
|
2012-12-06 11:10:14 +04:00
|
|
|
|
2013-08-21 03:52:18 +04:00
|
|
|
extern struct collect_image_info reg_file_cinfo;
|
|
|
|
extern struct collect_image_info remap_cinfo;
|
|
|
|
|
2013-11-01 00:50:48 +04:00
|
|
|
extern void delete_link_remaps(void);
|
|
|
|
extern void free_link_remaps(void);
|
|
|
|
|
2012-12-25 22:40:24 +04:00
|
|
|
#endif /* __CR_FILES_REG_H__ */
|