[CRIU] [PATCH 04/10] mounts: find mounts, which are propagated from a current one
Pavel Emelyanov
xemul at parallels.com
Thu Aug 29 09:00:18 EDT 2013
> @@ -93,6 +93,28 @@ struct mount_info *lookup_mnt_sdev(unsigned int s_dev)
> return NULL;
> }
>
> +/*
> + * Comparer two mounts. Return true if only mount points are differ.
> + * Don't care about root and mountpoints, if bind is true.
> + */
> +static bool mounts_equal(struct mount_info* mi, struct mount_info *c, bool bind)
> +{
> + if (mi->s_dev != c->s_dev ||
> + c->fstype != mi->fstype ||
> + strcmp(c->source, mi->source) ||
> + strcmp(c->options, mi->options))
> + return 0;
> +
> + if (bind)
> + return 1;
> +
> + if (strcmp(c->root, mi->root))
> + return 0;
> + if (strcmp(basename(c->mountpoint), basename(mi->mountpoint)))
> + return 0;
> + return 1;
Either bool/true/false or int/1/0 please.
> +}
> +
> static struct mount_info *mnt_build_ids_tree(struct mount_info *list)
> {
> struct mount_info *m, *root = NULL;
More information about the CRIU
mailing list