Skip to content

Commit

Permalink
mount: move functions about mounts from proc_parse.h
Browse files Browse the repository at this point in the history
It remove a dependece between  proc_parse.h and mount.c.

v2: type fix in the subject

Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
  • Loading branch information
avagin authored and xemul committed Sep 6, 2016
1 parent f2d55d9 commit d0d1179
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 27 deletions.
25 changes: 25 additions & 0 deletions criu/include/mount.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */
26 changes: 0 additions & 26 deletions criu/include/proc_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
Expand All @@ -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__ */
3 changes: 3 additions & 0 deletions criu/include/sysfs_parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#define SBINFO_PATH_LEN (sizeof SYSFS_AUFS + SBINFO_LEN) /* /sys/fs/aufs/<sbinfo> */
#define AUFSBR_PATH_LEN (SBINFO_PATH_LEN + 6 + 1) /* /sys/fs/aufs/<sbinfo>/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);
Expand Down
1 change: 0 additions & 1 deletion criu/mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit d0d1179

Please sign in to comment.