PatchworkOS  321f6ec
A non-POSIX operating system.
Loading...
Searching...
No Matches

Mount point. More...

Collaboration diagram for Mount:

Detailed Description

Mount point.

A mount represents a location that a superblock is mounted to. It links a superblock (the mounted filesystem) to a mountpoint (a dentry in another filesystem).

Data Structures

struct  mount_t
 Mount structure. More...
 

Macros

#define MOUNT_IS_ROOT(mount)   ((mount)->parent == (mount))
 Macro to check if a mount is the root filesystem.
 

Typedefs

typedef uint64_t mount_id_t
 Mount ID type.
 

Functions

mount_tmount_new (superblock_t *superblock, dentry_t *source, dentry_t *target, mount_t *parent, mode_t mode)
 Create a new mount.
 

Macro Definition Documentation

◆ MOUNT_IS_ROOT

#define MOUNT_IS_ROOT (   mount)    ((mount)->parent == (mount))

Macro to check if a mount is the root filesystem.

Definition at line 35 of file mount.h.

Typedef Documentation

◆ mount_id_t

Mount ID type.

Definition at line 30 of file mount.h.

Function Documentation

◆ mount_new()

mount_t * mount_new ( superblock_t superblock,
dentry_t source,
dentry_t target,
mount_t parent,
mode_t  mode 
)

Create a new mount.

This does not add the mount to the mount cache, that must be done separately with vfs_add_mount().

There is no mount_free() instead use UNREF().

Parameters
superblockThe superblock of the mounted filesystem.
sourceThe dentry to appear at target once mounted, usually the root dentry of the mounted filesystem.
targetThe dentry which the source is mounted to, can be NULL for the root filesystem.
parentThe parent mount, can be NULL for the root filesystem.
modeSpecifies the maximum permissions for this mount and if it is a directory or a file.
Returns
On success, the new mount. On failure, returns NULL and errno is set to:
  • EINVAL: Invalid parameters.
  • ENOENT: Source or target dentry is negative.
  • ENOTDIR: Source is a file but mode specifies a directory.
  • EISDIR: Source is a directory but mode specifies a file.
  • ENOMEM: Out of memory.

Definition at line 39 of file mount.c.

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