2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 15:55:53 +00:00

files: Support dumping/restoring of completely unlinked files

Completely unlinked file is the one with n_link count being zero.
Such files only allow to read their contents and carry with us.

In order to dump this thing I introduce the "path remap" technology.
For reg file a remapping entry is dumped which describes, that at
restore stage before opening a regfile->path this path should be
linked to some other name and then (after open) unlinked.

For completely unlinked files the remap path would be a path to
a "ghost" file, i.e. a file which is created only at the time of
restore and which is removed completely at the end of it.

Partially unlinked files (i.e. those having n_link != 0, but a
path by which we see them in someone's fd is not accessible) should
be handled in another way.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2012-04-13 17:54:36 +04:00
parent 14451ed3ce
commit a1ccfb9297
8 changed files with 341 additions and 10 deletions

View File

@@ -73,4 +73,6 @@ struct file_desc;
extern int collect_pipes(void);
extern void mark_pipe_master(void);
void clear_ghost_files(void);
#endif /* FILES_H_ */