|
PatchworkOS
966e257
A non-POSIX operating system.
|
Mountable filesystem. More...
Mountable filesystem.
A superblock represents a mounted filesystem, it can be thought of as "filesystem + device". The filesystem is just the format of the data, e.g. fat32, ramfs, sysfs, etc. and the device provides the data. The superblock is the combination of both, e.g. a fat32 filesystem on /dev/sda1.
In the case of certain special filesystems like ramfs or sysfs there is no underlying device, in this case the device name is simply set to VFS_DEVICE_NAME_NONE.
Data Structures | |
| struct | superblock_t |
| Superblock structure. More... | |
| struct | superblock_ops_t |
| Superblock operations structure. More... | |
Typedefs | |
| typedef uint64_t | superblock_id_t |
| Superblock ID type. | |
Functions | |
| superblock_t * | superblock_new (filesystem_t *fs, const char *deviceName, 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. | |
| typedef uint64_t superblock_id_t |
Superblock ID type.
Definition at line 35 of file superblock.h.
| superblock_t * superblock_new | ( | filesystem_t * | fs, |
| const char * | deviceName, | ||
| 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. |
| deviceName | The device name, or VFS_DEVICE_NAME_NONE for no device. |
| ops | The superblock operations, can be NULL. |
| dentryOps | The dentry operations for dentries in this superblock, can be NULL. |
NULL and errno is set. Definition at line 35 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 60 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 65 of file superblock.c.