PatchworkOS
Loading...
Searching...
No Matches
namespace.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/fs/path.h>
6#include <kernel/utils/map.h>
7
8typedef struct namespace namespace_t;
9typedef struct mount mount_t;
10typedef struct process process_t;
11
46// clang-format on
47
57
64
76uint64_t namespace_traverse_mount(namespace_t* ns, const path_t* mountpoint, path_t* outRoot);
77
92mount_t* namespace_mount(namespace_t* ns, path_t* mountpoint, const char* deviceName, const char* fsName,
93 void* private);
94
103mount_t* namespace_bind(namespace_t* ns, dentry_t* source, path_t* mountpoint);
104
113
static mount_t * mount
Definition acpi.c:15
uint64_t namespace_get_root_path(namespace_t *ns, path_t *outPath)
Get the root path of a namespace.
Definition namespace.c:274
uint64_t namespace_traverse_mount(namespace_t *ns, const path_t *mountpoint, path_t *outRoot)
Traverse a mountpoint path to the root of the mounted filesystem.
Definition namespace.c:73
void namespace_deinit(namespace_t *ns)
Deinitializes a namespace.
Definition namespace.c:48
mount_t * namespace_bind(namespace_t *ns, dentry_t *source, path_t *mountpoint)
Bind a directory to a mountpoint in a namespace.
Definition namespace.c:195
mount_t * namespace_mount(namespace_t *ns, path_t *mountpoint, const char *deviceName, const char *fsName, void *private)
Mount a filesystem in a namespace.
Definition namespace.c:107
uint64_t namespace_init(namespace_t *ns, namespace_t *parent, process_t *owner)
Initializes a namespace.
Definition namespace.c:28
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Directory entry structure.
Definition dentry.h:83
Hash map structure.
Definition map.h:76
Mount structure.
Definition mount.h:36
map_t mountPoints
Definition namespace.h:39
process_t * owner
The process that owns this namespace, will not take a reference.
Definition namespace.h:42
rwlock_t lock
Definition namespace.h:40
namespace_t * parent
Definition namespace.h:41
mount_t * rootMount
The root mount of the namespace, will be inherited from the parent namespace.
Definition namespace.h:43
Namespace structure.
Path structure.
Definition path.h:110
Process structure.
Definition process.h:53
Read-Write Ticket Lock structure.
Definition rwlock.h:59