PatchworkOS
Loading...
Searching...
No Matches
superblock.h
Go to the documentation of this file.
1#pragma once
2
3#include <kernel/fs/sysfs.h>
4#include <kernel/utils/ref.h>
5
6#include <stdint.h>
7#include <sys/io.h>
8#include <sys/list.h>
9
10typedef struct filesystem filesystem_t;
11typedef struct superblock superblock_t;
12typedef struct superblock_ops superblock_ops_t;
13typedef struct dentry_ops dentry_ops_t;
14typedef struct inode inode_t;
15typedef struct dentry dentry_t;
16
36
64
69typedef struct superblock_ops
70{
76 inode_t* (*allocInode)(superblock_t* superblock);
80 void (*freeInode)(superblock_t* superblock, inode_t* inode);
85 void (*cleanup)(superblock_t* superblock);
89 void (*unmount)(superblock_t* superblock);
91
108superblock_t* superblock_new(const filesystem_t* fs, const char* deviceName, const superblock_ops_t* ops,
109 const dentry_ops_t* dentryOps);
110
117
126
#define MAX_NAME
Maximum length of names.
Definition MAX_NAME.h:11
void superblock_inc_mount_count(superblock_t *superblock)
Increment the mount count of a superblock.
Definition superblock.c:57
uint64_t superblock_id_t
Superblock ID type.
Definition superblock.h:35
superblock_t * superblock_new(const filesystem_t *fs, const char *deviceName, const superblock_ops_t *ops, const dentry_ops_t *dentryOps)
Create a new superblock.
Definition superblock.c:32
void superblock_dec_mount_count(superblock_t *superblock)
Decrement the mount count of a superblock.
Definition superblock.c:62
static socket_family_ops_t ops
Definition local.c:505
static dentry_ops_t dentryOps
Definition ramfs.c:229
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
Dentry operations structure.
Definition dentry.h:70
Directory entry structure.
Definition dentry.h:83
Filesystem structure, represents a filesystem type, e.g. fat32, ramfs, sysfs, etc.
Definition vfs.h:45
Inode structure.
Definition inode.h:54
A entry in a doubly linked list.
Definition list.h:38
Reference counting structure.
Definition ref.h:30
Superblock operations structure.
Definition superblock.h:70
Superblock structure.
Definition superblock.h:44
uint64_t blockSize
Definition superblock.h:48
uint64_t maxFileSize
Definition superblock.h:49
const superblock_ops_t * ops
Definition superblock.h:52
atomic_uint64_t mountCount
Definition superblock.h:62
const filesystem_t * fs
Definition superblock.h:54
list_entry_t entry
Definition superblock.h:46
dentry_t * root
Definition superblock.h:51
const dentry_ops_t * dentryOps
Definition superblock.h:53
superblock_id_t id
Definition superblock.h:47