[CRIU] [PATCH 5/7] mount: mounts_equal -- Fix comment and a few style nits
Andrew Vagin
avagin at odin.com
Thu Sep 3 03:44:01 PDT 2015
On Thu, Sep 03, 2015 at 01:05:12PM +0300, Cyrill Gorcunov wrote:
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
> mount.c | 18 ++++++++----------
> 1 file changed, 8 insertions(+), 10 deletions(-)
>
> diff --git a/mount.c b/mount.c
> index ba4a0e370bae..47786a655fda 100644
> --- a/mount.c
> +++ b/mount.c
> @@ -275,23 +275,21 @@ bool phys_stat_dev_match(dev_t st_dev, dev_t phys_dev,
> }
>
> /*
> - * Comparer two mounts. Return true if only mount points are differ.
> - * Don't care about root and mountpoints, if bind is true.
> + * Two mountpoints are to be on the same device with same options
> + * mounted at least. For bind mounts we ignore @root and @mountpoint.
> */
> 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) ||
> + if (mi->s_dev != c->s_dev ||
> + c->fstype != mi->fstype ||
> + strcmp(c->source, mi->source) ||
> strcmp(c->options, mi->options))
> return false;
> -
> if (bind)
> return true;
1.
if (strcmp(c->root, mi->root))
return false;
if (strcmp(basename(c->mountpoint), basename(mi->mountpoint)))
return false;
2.
if (strcmp(c->root, mi->root) ||
strcmp(basename(c->mountpoint),
basename(mi->mountpoint)))
return false;
I like the first version...
> return true;
> }
> --
> 2.4.3
>
More information about the CRIU
mailing list