PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
namespace.c File Reference
#include <kernel/fs/namespace.h>
#include <kernel/cpu/syscall.h>
#include <kernel/fs/dentry.h>
#include <kernel/fs/filesystem.h>
#include <kernel/fs/mount.h>
#include <kernel/fs/path.h>
#include <kernel/fs/superblock.h>
#include <kernel/log/log.h>
#include <kernel/proc/process.h>
#include <kernel/sched/thread.h>
#include <kernel/sync/rwlock.h>
#include <kernel/utils/map.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/io.h>
Include dependency graph for namespace.c:

Go to the source code of this file.

Functions

static map_key_t mount_key (mount_id_t parentId, dentry_id_t mountpointId)
 
static uint64_t namespace_add (namespace_t *ns, mount_t *mount, mount_flags_t flags, map_key_t *key)
 
void namespace_init (namespace_t *ns)
 Initializes a namespace.
 
void namespace_deinit (namespace_t *ns)
 Clear and deinitialize a namespace.
 
uint64_t namespace_set_parent (namespace_t *ns, namespace_t *parent)
 Sets the parent of a namespace and inherits all mounts from the parent.
 
uint64_t namespace_traverse (namespace_t *ns, path_t *path)
 If the given path is a mountpoint in the namespace, traverse to the mounted filesystem, else no-op.
 
mount_tnamespace_mount (namespace_t *ns, path_t *target, const char *deviceName, const char *fsName, mount_flags_t flags, mode_t mode, void *private)
 Mount a filesystem in a namespace.
 
mount_tnamespace_bind (namespace_t *ns, dentry_t *source, path_t *target, mount_flags_t flags, mode_t mode)
 Bind a source dentry to a target path in a namespace.
 
uint64_t namespace_get_root_path (namespace_t *ns, path_t *out)
 Get the root path of a namespace.
 
void namespace_clear (namespace_t *ns)
 Clears all mounts from a namespace.
 
 SYSCALL_DEFINE (SYS_BIND, uint64_t, fd_t source, const char *mountpoint, mount_flags_t flags)
 

Function Documentation

◆ mount_key()

static map_key_t mount_key ( mount_id_t  parentId,
dentry_id_t  mountpointId 
)
static

Definition at line 19 of file namespace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ namespace_add()

static uint64_t namespace_add ( namespace_t ns,
mount_t mount,
mount_flags_t  flags,
map_key_t key 
)
static

Definition at line 32 of file namespace.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYSCALL_DEFINE()

SYSCALL_DEFINE ( SYS_BIND  ,
uint64_t  ,
fd_t  source,
const char *  mountpoint,
mount_flags_t  flags 
)

Definition at line 343 of file namespace.c.

Here is the call graph for this function: