2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 01:51:51 +00:00

crtools: move pid_rst_prio to pid.h

crtools.h is too heavy to be included in many sources

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Andrey Vagin 2013-11-06 17:21:13 +04:00 committed by Pavel Emelyanov
parent 72727bb3ed
commit a434e7f075
22 changed files with 19 additions and 27 deletions

View File

@ -25,6 +25,7 @@
#include "ipc_ns.h"
#include "pstree.h"
#include "cr-show.h"
#include "crtools.h"
#include "protobuf.h"
#include "protobuf/pstree.pb-c.h"

View File

@ -17,7 +17,6 @@
#include "fdset.h"
#include "eventfd.h"
#include "proc_parse.h"
#include "crtools.h"
#include "image.h"
#include "util.h"
#include "log.h"

View File

@ -18,7 +18,6 @@
#include "rst_info.h"
#include "eventpoll.h"
#include "proc_parse.h"
#include "crtools.h"
#include "image.h"
#include "util.h"
#include "log.h"

1
fifo.c
View File

@ -4,7 +4,6 @@
#include <fcntl.h>
#include <stdlib.h>
#include "crtools.h"
#include "fdset.h"
#include "image.h"
#include "files.h"

View File

@ -13,8 +13,6 @@
#include <sys/un.h>
#include <stdlib.h>
#include "crtools.h"
#include "files.h"
#include "file-ids.h"
#include "files-reg.h"

View File

@ -27,7 +27,6 @@
#include "fsnotify.h"
#include "proc_parse.h"
#include "syscall.h"
#include "crtools.h"
#include "mount.h"
#include "image.h"
#include "util.h"

View File

@ -1,5 +1,6 @@
#include <unistd.h>
#include <stdarg.h>
#include "crtools.h"
#include "cr_options.h"
#include "fdset.h"
#include "image.h"

View File

@ -23,16 +23,6 @@ int convert_to_elf(char *elf_path, int fd_core);
int cr_check(void);
int cr_exec(int pid, char **opts);
/*
* When we have to restore a shared resource, we mush select which
* task should do it, and make other(s) wait for it. In order to
* avoid deadlocks, always make task with lower pid be the restorer.
*/
static inline bool pid_rst_prio(unsigned pid_a, unsigned pid_b)
{
return pid_a < pid_b;
}
void restrict_uid(unsigned int uid, unsigned int gid);
struct proc_status_creds;
bool may_dump(struct proc_status_creds *);

View File

@ -6,7 +6,7 @@
#include "lock.h"
#include "list.h"
#include "image.h"
#include "crtools.h"
#include "pid.h"
#include "protobuf/fdinfo.pb-c.h"
#include "protobuf/fown.pb-c.h"

View File

@ -4,6 +4,7 @@
#include <stdbool.h>
#include "compiler.h"
#include "servicefd.h"
#include "image-desc.h"
#include "magic.h"

View File

@ -1,6 +1,8 @@
#ifndef __CR_PID_H__
#define __CR_PID_H__
#include "stdbool.h"
struct pid {
/*
* The @real pid is used to fetch tasks during dumping stage,
@ -17,4 +19,14 @@ struct pid {
pid_t virt;
};
/*
* When we have to restore a shared resource, we mush select which
* task should do it, and make other(s) wait for it. In order to
* avoid deadlocks, always make task with lower pid be the restorer.
*/
static inline bool pid_rst_prio(unsigned pid_a, unsigned pid_b)
{
return pid_a < pid_b;
}
#endif

View File

@ -1,6 +1,8 @@
#ifndef __CR_SERVICE_FD_H__
#define __CR_SERVICE_FD_H__
#include <stdbool.h>
enum sfd_type {
SERVICE_FD_MIN,

View File

@ -5,7 +5,6 @@
#include <stdlib.h>
#include <sys/mman.h>
#include "crtools.h"
#include "fdset.h"
#include "image.h"
#include "files.h"

View File

@ -12,7 +12,6 @@
#include "asm/types.h"
#include "list.h"
#include "util.h"
#include "crtools.h"
#include "mount.h"
#include "cpu.h"
#include "file-lock.h"

View File

@ -13,7 +13,6 @@
#include <sys/resource.h>
#include <sys/wait.h>
#include "crtools.h"
#include "compiler.h"
#include "asm/types.h"
#include "util.h"

View File

@ -2,9 +2,9 @@
#include <sys/mman.h>
#include <stdlib.h>
#include "pid.h"
#include "shmem.h"
#include "image.h"
#include "crtools.h"
#include "page-pipe.h"
#include "page-xfer.h"
#include "rst-malloc.h"

View File

@ -6,7 +6,6 @@
#include "asm/types.h"
#include "signalfd.h"
#include "proc_parse.h"
#include "crtools.h"
#include "fdset.h"
#include "image.h"
#include "util.h"

View File

@ -3,7 +3,6 @@
#include <linux/rtnetlink.h>
#include <poll.h>
#include "crtools.h"
#include "fdset.h"
#include "files.h"
#include "sockets.h"

View File

@ -15,7 +15,6 @@
#include "fdset.h"
#include "image.h"
#include "servicefd.h"
#include "crtools.h"
#include "cr_options.h"
#include "util.h"
#include "util-pie.h"

View File

@ -18,7 +18,6 @@
#include "util-pie.h"
#include "sk-packet.h"
#include "namespaces.h"
#include "crtools.h"
#include "net.h"
#ifndef NETLINK_SOCK_DIAG

View File

@ -3,7 +3,6 @@
#include "asm/atomic.h"
#include "protobuf.h"
#include "stats.h"
#include "crtools.h"
#include "image.h"
#include "protobuf/stats.pb-c.h"

View File

@ -4,7 +4,6 @@
#include <string.h>
#include "util.h"
#include "crtools.h"
#include "syscall.h"
#include "namespaces.h"
#include "sysctl.h"