Commit a135b40b authored by Pavel Emelyanov's avatar Pavel Emelyanov

ghost-files: Merge dump and restore helper structs

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 218f0a9b
...@@ -14,22 +14,23 @@ ...@@ -14,22 +14,23 @@
#include "files-reg.h" #include "files-reg.h"
struct ghost_file {
struct list_head list;
u32 id;
char *path;
};
/* /*
* Ghost files are those not visible from the FS. Dumping them is * Ghost files are those not visible from the FS. Dumping them is
* nasty and the only way we have -- just carry its contents with * nasty and the only way we have -- just carry its contents with
* us. Any brave soul to implement link unlinked file back? * us. Any brave soul to implement link unlinked file back?
*/ */
struct ghost_file_dumpee { struct ghost_file {
struct list_head list; struct list_head list;
u32 id; u32 id;
union {
struct /* for dumping */ {
u32 dev; u32 dev;
u32 ino; u32 ino;
};
struct /* for restoring */ {
char *path;
};
};
}; };
static u32 ghost_file_ids = 1; static u32 ghost_file_ids = 1;
...@@ -212,7 +213,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st) ...@@ -212,7 +213,7 @@ static int dump_ghost_file(int _fd, u32 id, const struct stat *st)
static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id) static int dump_ghost_remap(char *path, const struct stat *st, int lfd, u32 id)
{ {
struct ghost_file_dumpee *gf; struct ghost_file *gf;
struct remap_file_path_entry rpe; struct remap_file_path_entry rpe;
pr_info("Dumping ghost file for fd %d id %#x\n", lfd, id); pr_info("Dumping ghost file for fd %d id %#x\n", lfd, id);
......
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