Commit 2c623a56 authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Move fstypes related code into separate files

After this the mount.c is no longer the fattest .c in the tree:

  - before
    3947 criu/mount.c
    3179 criu/cr-restore.c
    2622 criu/proc_parse.c
    2095 criu/tty.c

  - after
    3179 criu/cr-restore.c
    3170 criu/mount.c
    2623 criu/proc_parse.c
    2095 criu/tty.c

One "not move" thing is -- since fstype array is static to the
filesystems.c and mount.c needs to access fstype[1] for auto
mounts, the fstype_auto() call is added.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent f0ea03bd
...@@ -35,6 +35,7 @@ obj-y += log.o ...@@ -35,6 +35,7 @@ obj-y += log.o
obj-y += lsm.o obj-y += lsm.o
obj-y += mem.o obj-y += mem.o
obj-y += mount.o obj-y += mount.o
obj-y += filesystems.o
obj-y += namespaces.o obj-y += namespaces.o
obj-y += netfilter.o obj-y += netfilter.o
obj-y += net.o obj-y += net.o
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "page-xfer.h" #include "page-xfer.h"
#include "net.h" #include "net.h"
#include "mount.h" #include "mount.h"
#include "filesystems.h"
#include "cgroup.h" #include "cgroup.h"
#include "cgroup-props.h" #include "cgroup-props.h"
#include "action-scripts.h" #include "action-scripts.h"
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "cr-service.h" #include "cr-service.h"
#include "plugin.h" #include "plugin.h"
#include "mount.h" #include "mount.h"
#include "filesystems.h"
#include "namespaces.h" #include "namespaces.h"
#include "cgroup.h" #include "cgroup.h"
#include "cgroup-props.h" #include "cgroup-props.h"
......
This diff is collapsed.
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "fsnotify.h" #include "fsnotify.h"
#include "fdinfo.h" #include "fdinfo.h"
#include "mount.h" #include "mount.h"
#include "filesystems.h"
#include "image.h" #include "image.h"
#include "util.h" #include "util.h"
#include "files.h" #include "files.h"
......
#ifndef __CR_FILESYSTEMS_H__
#define __CR_FILESYSTEMS_H__
extern struct fstype *find_fstype_by_name(char *fst);
extern struct fstype *decode_fstype(u32 fst);
extern bool add_fsname_auto(const char *names);
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 struct fstype *fstype_auto(void);
/* callback for AUFS support */
extern int aufs_parse(struct mount_info *mi);
/* callback for OverlayFS support */
extern int overlayfs_parse(struct mount_info *mi);
/* FIXME -- remove */
extern struct list_head binfmt_misc_list;
#endif
...@@ -102,8 +102,7 @@ extern struct ns_id *lookup_nsid_by_mnt_id(int mnt_id); ...@@ -102,8 +102,7 @@ extern struct ns_id *lookup_nsid_by_mnt_id(int mnt_id);
extern int open_mount(unsigned int s_dev); extern int open_mount(unsigned int s_dev);
extern int __open_mountpoint(struct mount_info *pm, int mnt_fd); extern int __open_mountpoint(struct mount_info *pm, int mnt_fd);
extern struct fstype *find_fstype_by_name(char *fst); extern int open_mountpoint(struct mount_info *pm);
extern bool add_fsname_auto(const char *names);
extern struct mount_info *collect_mntinfo(struct ns_id *ns, bool for_dump); extern struct mount_info *collect_mntinfo(struct ns_id *ns, bool for_dump);
extern int prepare_mnt_ns(void); extern int prepare_mnt_ns(void);
...@@ -130,29 +129,10 @@ extern int read_mnt_ns_img(void); ...@@ -130,29 +129,10 @@ extern int read_mnt_ns_img(void);
extern void cleanup_mnt_ns(void); extern void cleanup_mnt_ns(void);
extern void clean_cr_time_mounts(void); extern void clean_cr_time_mounts(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); extern bool add_skip_mount(const char *mountpoint);
struct ns_id; struct ns_id;
extern struct mount_info *parse_mountinfo(pid_t pid, struct ns_id *nsid, bool for_dump); 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); extern int check_mnt_id(void);
#endif /* __CR_MOUNT_H__ */ #endif /* __CR_MOUNT_H__ */
This diff is collapsed.
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "list.h" #include "list.h"
#include "util.h" #include "util.h"
#include "mount.h" #include "mount.h"
#include "filesystems.h"
#include "mman.h" #include "mman.h"
#include "cpu.h" #include "cpu.h"
#include "file-lock.h" #include "file-lock.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment