criu/include/file-ids.h
Pavel Emelyanov c92c9e234e file-ids: Enlighten ID generation and storage
The unique id is 32 bit and consists only of the subid value. This
is _really_ enough. The genid part is just a hint for the tree-search
algirythm to avoid unneeded sys_kcmp calls.

Plus, generate IDs for special files. This will make it easier to
move the regfiles into into separate files (see the respective patch
for details).

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-03-25 20:58:19 +04:00

18 lines
393 B
C

#ifndef FILE_IDS_H__
#define FILE_IDS_H__
#include "compiler.h"
#include "types.h"
#include "rbtree.h"
#define FD_ID_INVALID (-1U)
#define FD_PID_INVALID (-2U)
#define MAKE_FD_GENID(dev, ino, pos) \
(((u32)(dev) ^ (u32)(ino) ^ (u32)(pos)))
struct fdinfo_entry;
extern int fd_id_generate(pid_t pid, struct fdinfo_entry *fe);
extern void fd_id_show_tree(void);
#endif /* FILE_IDS_H__ */