PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
namespace.h File Reference
#include <kernel/fs/path.h>
#include <kernel/fs/superblock.h>
#include <kernel/sync/rwlock.h>
#include <kernel/utils/map.h>
#include <kernel/utils/ref.h>
#include <stdint.h>
#include <sys/fs.h>
#include <sys/list.h>
Include dependency graph for namespace.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mount_stack_t
 Mount stack. More...
 
struct  namespace_t
 Namespace structure. More...
 

Macros

#define NAMESPACE_MAX_TRAVERSE   32
 Maximum number of iterative mount traversals when following mountpoints.
 
#define MOUNT_STACK_MAX_MOUNTS   8
 Maximum number of mounts that can be mounted to a single mountpoint.
 

Typedefs

typedef struct namespace namespace_t
 
typedef struct mount mount_t
 
typedef struct process process_t
 
typedef struct dentry dentry_t
 

Functions

namespace_tnamespace_new (namespace_t *parent)
 Create a new namespace.
 
uint64_t namespace_copy (namespace_t *dest, namespace_t *src)
 Copy mounts from one namespace to another.
 
bool namespace_accessible (namespace_t *ns, namespace_t *other)
 Check if mounts in a namespace can be propagated to another 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 critical section, else no-op.
 
mount_tnamespace_mount (namespace_t *ns, path_t *target, filesystem_t *fs, const char *options, mode_t mode, void *data)
 Mount a filesystem in a namespace.
 
mount_tnamespace_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.
 
void namespace_get_root (namespace_t *ns, path_t *out)
 Get the root path of 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.
 

Typedef Documentation

◆ namespace_t

typedef struct namespace namespace_t

Definition at line 12 of file namespace.h.

◆ mount_t

typedef struct mount mount_t

Definition at line 13 of file namespace.h.

◆ process_t

typedef struct process process_t

Definition at line 14 of file namespace.h.

◆ dentry_t

typedef struct dentry dentry_t

Definition at line 15 of file namespace.h.