mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
Speed up service-fd retrieval
We're using get_service_fd in file engine, better to make it fast. This patch caches the limits system provides us, instead of calling getrlimit() every time. This patch introduces is_service_fd helper which will be used instead of get_service_fd where it make sense. Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
committed by
Pavel Emelyanov
parent
b354a09cd7
commit
45cc85eea4
@@ -100,16 +100,22 @@ struct cr_options {
|
||||
|
||||
extern struct cr_options opts;
|
||||
|
||||
enum {
|
||||
LOG_FD_OFF = 1,
|
||||
enum sfd_type {
|
||||
SERVICE_FD_MIN,
|
||||
|
||||
LOG_FD_OFF,
|
||||
LOG_DIR_FD_OFF,
|
||||
IMG_FD_OFF,
|
||||
SELF_EXE_FD_OFF,
|
||||
PROC_FD_OFF,
|
||||
CTL_TTY_OFF,
|
||||
|
||||
SERVICE_FD_MAX
|
||||
};
|
||||
|
||||
int get_service_fd(int type);
|
||||
extern int init_service_fd(void);
|
||||
extern int get_service_fd(enum sfd_type type);
|
||||
extern bool is_service_fd(int fd, enum sfd_type type);
|
||||
|
||||
/* file descriptors template */
|
||||
struct cr_fd_desc_tmpl {
|
||||
|
Reference in New Issue
Block a user