Commit 4496bdff authored by Pavel Emelyanov's avatar Pavel Emelyanov

mount: Add ->collect callback

This helps cleanup cr-time mounts a little bit.

travis-ci: success for mount: Add ->collect callback
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 2be8b150
...@@ -39,7 +39,7 @@ struct binfmt_misc_info { ...@@ -39,7 +39,7 @@ struct binfmt_misc_info {
LIST_HEAD(binfmt_misc_list); LIST_HEAD(binfmt_misc_list);
static int binfmt_misc_parse(struct mount_info *pm) static int binfmt_misc_parse_or_collect(struct mount_info *pm)
{ {
opts.has_binfmt_misc = true; opts.has_binfmt_misc = true;
return 0; return 0;
...@@ -375,7 +375,7 @@ int collect_binfmt_misc(void) ...@@ -375,7 +375,7 @@ int collect_binfmt_misc(void)
#else #else
#define binfmt_misc_dump NULL #define binfmt_misc_dump NULL
#define binfmt_misc_restore NULL #define binfmt_misc_restore NULL
#define binfmt_misc_parse NULL #define binfmt_misc_parse_or_collect NULL
#endif #endif
static int tmpfs_dump(struct mount_info *pm) static int tmpfs_dump(struct mount_info *pm)
...@@ -684,7 +684,8 @@ static struct fstype fstypes[] = { ...@@ -684,7 +684,8 @@ static struct fstype fstypes[] = {
.restore = devtmpfs_restore, .restore = devtmpfs_restore,
}, { }, {
.name = "binfmt_misc", .name = "binfmt_misc",
.parse = binfmt_misc_parse, .parse = binfmt_misc_parse_or_collect,
.collect = binfmt_misc_parse_or_collect,
.code = FSTYPE__BINFMT_MISC, .code = FSTYPE__BINFMT_MISC,
.dump = binfmt_misc_dump, .dump = binfmt_misc_dump,
.restore = binfmt_misc_restore, .restore = binfmt_misc_restore,
......
...@@ -14,6 +14,7 @@ struct fstype { ...@@ -14,6 +14,7 @@ struct fstype {
int (*dump)(struct mount_info *pm); int (*dump)(struct mount_info *pm);
int (*restore)(struct mount_info *pm); int (*restore)(struct mount_info *pm);
int (*parse)(struct mount_info *pm); int (*parse)(struct mount_info *pm);
int (*collect)(struct mount_info *pm);
bool (*sb_equal)(struct mount_info *a, struct mount_info *b); bool (*sb_equal)(struct mount_info *a, struct mount_info *b);
mount_fn_t mount; mount_fn_t mount;
}; };
......
...@@ -2580,13 +2580,11 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid) ...@@ -2580,13 +2580,11 @@ static int collect_mnt_from_image(struct mount_info **pms, struct ns_id *nsid)
goto err; goto err;
} }
#ifdef CONFIG_BINFMT_MISC_VIRTUALIZED
if (me->fstype == FSTYPE__BINFMT_MISC)
opts.has_binfmt_misc = true;
#endif
/* FIXME: abort unsupported early */ /* FIXME: abort unsupported early */
pm->fstype = decode_fstype(me->fstype); pm->fstype = decode_fstype(me->fstype);
if (pm->fstype->collect && (pm->fstype->collect(pm) < 0))
goto err;
if (me->fsname) { if (me->fsname) {
pm->fsname = xstrdup(me->fsname); pm->fsname = xstrdup(me->fsname);
......
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