From d0d117986ef42066d6ffcba346a8e3ca6908d995 Mon Sep 17 00:00:00 2001 From: Andrei Vagin Date: Tue, 16 Aug 2016 20:16:56 +0300 Subject: [PATCH] mount: move functions about mounts from proc_parse.h It remove a dependece between proc_parse.h and mount.c. v2: type fix in the subject Signed-off-by: Andrei Vagin Signed-off-by: Pavel Emelyanov --- criu/include/mount.h | 25 +++++++++++++++++++++++++ criu/include/proc_parse.h | 26 -------------------------- criu/include/sysfs_parse.h | 3 +++ criu/mount.c | 1 - 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/criu/include/mount.h b/criu/include/mount.h index d3f472df12..a266cd0ad8 100644 --- a/criu/include/mount.h +++ b/criu/include/mount.h @@ -128,4 +128,29 @@ extern int mntns_maybe_create_roots(void); extern int read_mnt_ns_img(void); extern void cleanup_mnt_ns(void); +struct mount_info; +typedef int (*mount_fn_t)(struct mount_info *mi, const char *src, const + char *fstype, unsigned long mountflags); + +struct fstype { + char *name; + int code; + int (*dump)(struct mount_info *pm); + int (*restore)(struct mount_info *pm); + int (*parse)(struct mount_info *pm); + mount_fn_t mount; +}; + +extern bool add_skip_mount(const char *mountpoint); +struct ns_id; +extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump); + +/* callback for AUFS support */ +extern int aufs_parse(struct mount_info *mi); + +/* callback for OverlayFS support */ +extern int overlayfs_parse(struct mount_info *mi); + +extern int check_mnt_id(void); + #endif /* __CR_MOUNT_H__ */ diff --git a/criu/include/proc_parse.h b/criu/include/proc_parse.h index 4bc0ffa38b..889aee1f6f 100644 --- a/criu/include/proc_parse.h +++ b/criu/include/proc_parse.h @@ -103,26 +103,8 @@ struct proc_status_creds { bool proc_status_creds_dumpable(struct proc_status_creds *parent, struct proc_status_creds *child); -struct mount_info; -typedef int (*mount_fn_t)(struct mount_info *mi, const char *src, const - char *fstype, unsigned long mountflags); - -struct fstype { - char *name; - int code; - int (*dump)(struct mount_info *pm); - int (*restore)(struct mount_info *pm); - int (*parse)(struct mount_info *pm); - mount_fn_t mount; -}; - -struct vm_area_list; - #define INVALID_UID ((uid_t)-1) -extern bool add_skip_mount(const char *mountpoint); -struct ns_id; -extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump); extern int parse_pid_stat(pid_t pid, struct proc_pid_stat *s); extern unsigned int parse_pid_loginuid(pid_t pid, int *err, bool ignore_noent); extern int parse_pid_oom_score_adj(pid_t pid, int *err); @@ -180,8 +162,6 @@ extern int get_fd_mntid(int fd, int *mnt_id); struct pid; extern int parse_threads(int pid, struct pid **_t, int *_n); -extern int check_mnt_id(void); - /* * This struct describes a group controlled by one controller. * The @name is the controller name or 'name=...' for named cgroups. @@ -205,12 +185,6 @@ extern void put_ctls(struct list_head *); int collect_controllers(struct list_head *cgroups, unsigned int *n_cgroups); -/* callback for AUFS support */ -extern int aufs_parse(struct mount_info *mi); - -/* callback for OverlayFS support */ -extern int overlayfs_parse(struct mount_info *mi); - int parse_children(pid_t pid, pid_t **_c, int *_n); #endif /* __CR_PROC_PARSE_H__ */ diff --git a/criu/include/sysfs_parse.h b/criu/include/sysfs_parse.h index 3d49b4cf9e..3ba06ed567 100644 --- a/criu/include/sysfs_parse.h +++ b/criu/include/sysfs_parse.h @@ -6,6 +6,9 @@ #define SBINFO_PATH_LEN (sizeof SYSFS_AUFS + SBINFO_LEN) /* /sys/fs/aufs/ */ #define AUFSBR_PATH_LEN (SBINFO_PATH_LEN + 6 + 1) /* /sys/fs/aufs//br%3d */ +struct mount_info; +struct vma_area; + extern int parse_aufs_branches(struct mount_info *mi); extern int fixup_aufs_vma_fd(struct vma_area *vma, int vm_file_fd); extern void free_aufs_branches(void); diff --git a/criu/mount.c b/criu/mount.c index 1c205aeaf0..fe120a17ca 100644 --- a/criu/mount.c +++ b/criu/mount.c @@ -21,7 +21,6 @@ #include "plugin.h" #include "mount.h" #include "pstree.h" -#include "proc_parse.h" #include "image.h" #include "namespaces.h" #include "protobuf.h"