mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 22:35:33 +00:00
files: Split fdinfo in two parts
Make fdinfo_entry carry only the minimal info describing a file descriptor -- the fd value itself, the fd type (regular file, exe link, cwd, filemap and it will be pipes, sockets, inotifies, etc.) and the describing file ID. The mentioned ID will identify the type-d object, e.g. for regfiles this ID is already generated with file-ids.c code. The other part of this structure describes a regfile (i.e. a file opened with open syscall). I put this new entry at the end of the fdinfo_entry just to make the patching simpler. Soon this entry will be dumped into its own file. Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -44,16 +44,21 @@ enum fd_types {
|
||||
#define PAGE_RSS 1
|
||||
#define PAGE_ANON 2
|
||||
|
||||
struct fdinfo_entry {
|
||||
u8 type;
|
||||
u16 len;
|
||||
u16 flags;
|
||||
u64 pos;
|
||||
u64 addr;
|
||||
struct reg_file_entry {
|
||||
u32 id;
|
||||
u16 flags;
|
||||
u16 len;
|
||||
u64 pos;
|
||||
u8 name[0];
|
||||
} __packed;
|
||||
|
||||
struct fdinfo_entry {
|
||||
u64 addr;
|
||||
u8 type;
|
||||
u32 id;
|
||||
struct reg_file_entry rfe;
|
||||
} __packed;
|
||||
|
||||
#define fd_is_special(fe) \
|
||||
(((fe)->type == FDINFO_MAP) || \
|
||||
((fe)->type == FDINFO_CWD) || \
|
||||
|
Reference in New Issue
Block a user