Commit 2e8970be authored by Andrei Vagin's avatar Andrei Vagin Committed by Pavel Emelyanov

mount: create a mount point for the root mount namespace in the roots yard

These chnages allows us to:
* avoid difference between the root mount namespace and other mount namespaces
* support a read-only root mount
* don't create temporary directories in the root mount
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent b20780d6
#ifndef __CR_PATH_H__
#define __CR_PATH_H__
#include "namespaces.h"
#include "pstree.h"
/* Asolute paths are used on dump and relative paths are used on restore */
static inline int is_root(char *p)
{
......@@ -10,7 +13,7 @@ static inline int is_root(char *p)
/* True for the root mount (the topmost one) */
static inline int is_root_mount(struct mount_info *mi)
{
return is_root(mi->mountpoint + 1);
return mi->parent == NULL && mi->nsid->id == root_item->ids->mnt_ns_id;
}
/*
......
This diff is collapsed.
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