PatchworkOS  19e446b
A non-POSIX operating system.
Loading...
Searching...
No Matches
Superblock

Mounted filesystem. More...

Collaboration diagram for Superblock:

Detailed Description

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_tsuperblock_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.
 

Function Documentation

◆ superblock_new()

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.

Parameters
fsThe filesystem type of the superblock.
opsThe superblock operations, can be NULL.
dentryOpsThe dentry operations for dentries in this superblock, can be NULL.
Returns
On success, the new superblock. On failure, returns NULL and errno is set to:
  • EINVAL: Invalid parameters.
  • ENOMEM: Out of memory.

Definition at line 33 of file superblock.c.

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

◆ superblock_inc_mount_count()

void superblock_inc_mount_count ( superblock_t superblock)

Increment the mount count of a superblock.

Parameters
superblockPointer to the superblock.

Definition at line 68 of file superblock.c.

Here is the caller graph for this function:

◆ superblock_dec_mount_count()

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.

Parameters
superblockPointer to the superblock.

Definition at line 73 of file superblock.c.

Here is the caller graph for this function: