|
PatchworkOS
|
Mount point. More...
Data Structures | |
| struct | mount_t |
| Mount structure. More... | |
Typedefs | |
| typedef uint64_t | mount_id_t |
| Mount ID type. | |
Functions | |
| mount_t * | mount_new (superblock_t *superblock, dentry_t *root, dentry_t *mountpoint, mount_t *parent) |
| Create a new mount. | |
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).
| typedef uint64_t mount_id_t |
| mount_t * mount_new | ( | superblock_t * | superblock, |
| dentry_t * | root, | ||
| dentry_t * | mountpoint, | ||
| mount_t * | parent | ||
| ) |
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 DEREF().
Note that the root dentry is not necessarily the same as superblock->root, instead its the directory that will "appear" to be the root of the newly mounted filesystem, the dentry that gets jumped to durning the lookup. This is important for implementing bind mounts.
| superblock | The superblock of the mounted filesystem. |
| root | The root dentry of the mounted filesystem. |
| mountpoint | The dentry that this filesystem will be mounted on, can be NULL for the root filesystem. |
| parent | The parent mount, can be NULL for the root filesystem. |
NULL and errno is set. Definition at line 39 of file mount.c.
References dentry_inc_mount_count(), EINVAL, errno, mount_t::id, malloc(), map_entry_init(), mount_t::mapEntry, mount, mount_free(), mount_t::mountpoint, NULL, mount_t::parent, mount_t::ref, REF, ref_init(), mount_t::root, mount_t::superblock, superblock_inc_mount_count(), and vfs_get_new_id().
Referenced by namespace_bind(), and namespace_mount().