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
|
|
|
|
2012-07-17 07:17:02 +04:00
|
|
|
#include "../protobuf/regfile.pb-c.h"
|
2012-07-17 07:17:51 +04:00
|
|
|
#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;
|
|
|
|
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;
|
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);
|
2012-07-01 17:56:00 +04:00
|
|
|
extern int open_path_by_id(u32 id, int (*open_cb)(struct reg_file_info *, void *), void *arg);
|
2012-06-20 20:00:30 +04:00
|
|
|
extern void clear_ghost_files(void);
|
|
|
|
extern int collect_reg_files(void);
|
|
|
|
|
2012-09-17 20:12:58 +04:00
|
|
|
extern int prepare_shared_reg_files(void);
|
|
|
|
|
2012-06-20 20:00:30 +04:00
|
|
|
extern int dump_reg_file(struct fd_parms *p, int lfd, const struct cr_fdset *cr_fdset);
|
|
|
|
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);
|
|
|
|
|
2012-12-25 22:40:24 +04:00
|
|
|
#endif /* __CR_FILES_REG_H__ */
|