|
PatchworkOS
19e446b
A non-POSIX operating system.
|
Mounted filesystem. More...
Mounted filesystem.
A superblock represents a mounted filesystem.
Data Structures | |
| struct | superblock_t |
| Superblock structure. More... | |
| struct | superblock_ops_t |
| Superblock operations structure. More... | |
Functions | |
| superblock_t * | superblock_new (filesystem_t *fs, const superblock_ops_t *ops, const dentry_ops_t *dentryOps) |
| Create a new superblock. | |
| void | superblock_inc_mount_count (superblock_t *superblock) |
| Increment the mount count of a superblock. | |
| void | superblock_dec_mount_count (superblock_t *superblock) |
| Decrement the mount count of a superblock. | |
| superblock_t * superblock_new | ( | filesystem_t * | fs, |
| const superblock_ops_t * | ops, | ||
| const dentry_ops_t * | dentryOps | ||
| ) |
Create a new superblock.
This does not add the superblock to the superblock cache, the vfs_mount() function will do that using vfs_add_superblock().
There is no superblock_free() instead use UNREF().
Note that the superblock's root dentry must be created and assigned after calling this function.
| fs | The filesystem type of the superblock. |
| ops | The superblock operations, can be NULL. |
| dentryOps | The dentry operations for dentries in this superblock, can be NULL. |
NULL and errno is set to:EINVAL: Invalid parameters.ENOMEM: Out of memory. Definition at line 33 of file superblock.c.
| void superblock_inc_mount_count | ( | superblock_t * | superblock | ) |
Increment the mount count of a superblock.
| superblock | Pointer to the superblock. |
Definition at line 68 of file superblock.c.
| void superblock_dec_mount_count | ( | superblock_t * | superblock | ) |
Decrement the mount count of a superblock.
If the mount count reaches zero, the unmount operation is called if its not NULL.
| superblock | Pointer to the superblock. |
Definition at line 73 of file superblock.c.