31#define NAMESPACE_MAX_TRAVERSE 32
36#define MOUNT_STACK_MAX_MOUNTS 8
44typedef struct mount_stack
56typedef struct namespace
static clock_source_t source
Structure to describe the HPET to the sys time subsystem.
mount_t * namespace_bind(namespace_t *ns, path_t *target, path_t *source, mode_t mode)
Bind a source path to a target path in a namespace.
void namespace_unmount(namespace_t *ns, mount_t *mount, mode_t mode)
Remove a mount in a namespace.
#define MOUNT_STACK_MAX_MOUNTS
Maximum number of mounts that can be mounted to a single mountpoint.
uint64_t namespace_copy(namespace_t *dest, namespace_t *src)
Copy mounts from one namespace to another.
namespace_t * namespace_new(namespace_t *parent)
Create a new namespace.
mount_t * namespace_mount(namespace_t *ns, path_t *target, filesystem_t *fs, const char *options, mode_t mode, void *data)
Mount a filesystem in a namespace.
void namespace_rcu_get_root(namespace_t *ns, mount_t **mount, dentry_t **dentry)
Get the root mount of a namespace in an RCU read critical section.
void namespace_get_root(namespace_t *ns, path_t *out)
Get the root path of a namespace.
bool namespace_rcu_traverse(namespace_t *ns, mount_t **mount, dentry_t **dentry)
If the given path is a mountpoint in the namespace, traverse to the mounted filesystem in an RCU read...
bool namespace_accessible(namespace_t *ns, namespace_t *other)
Check if mounts in a namespace can be propagated to another namespace.
mode_t
Path flags and permissions.
uint64_t mount(const char *mountpoint, const char *fs, const char *options)
System call for mounting a filesystem.
Directory entry structure.
Filesystem structure, represents a filesystem type, e.g. fat32, tmpfs, devfs, etc.
A entry in a doubly linked list.
mount_stack_t root
The root mount stack.
list_entry_t entry
The entry for the parent's children list.
namespace_t * parent
The parent namespace, can be NULL.
list_t stacks
List of mount_stack_t in this namespace.
map_t mountMap
Map used to go from source dentries to namespace mount stacks.
list_t children
List of child namespaces.
Reference counting structure.
Read-Write Ticket Lock structure.