Contains superblock struct and its methods. More...
#include <stdint.h>#include <stdbool.h>Go to the source code of this file.
Functions | |
| struct | __attribute__ ((__packed__)) fs_info |
| Contains main information about FS. More... | |
| size_t | sizeof_superblock (const struct superblock *superblock) |
| void | init_super_block (struct superblock *superblock) |
| Constructor of superblock. More... | |
| void | destroy_super_block (struct superblock *superblock) |
| Destructor of superblock. More... | |
| ssize_t | read_super_block (int fd, struct superblock *superblock) |
| Read sb from memory. More... | |
| ssize_t | write_super_block (int fd, struct superblock *superblock) |
| Write sb to memory. More... | |
| uint16_t | reserve_inode (const struct superblock *superblock) |
| Reserve free inode. More... | |
| uint16_t | free_inode (const struct superblock *superblock, uint16_t inode_id) |
| Release inode. More... | |
| uint16_t | reserve_block (const struct superblock *superblock) |
| Reserve block. More... | |
| uint16_t | free_block (const struct superblock *superblock, uint16_t block_id) |
| Release block. More... | |
| struct __attribute__ | ( | (__packed__) | ) |
Contains main information about FS.
Main suberblock struct Contains fs_info and masks for blocks and inodes.
Definition at line 16 of file superblock.h.
| void destroy_super_block | ( | struct superblock * | superblock | ) |
| uint16_t free_block | ( | const struct superblock * | superblock, |
| uint16_t | block_id | ||
| ) |
Release block.
| superblock | |
| block_id | id of block to release |
Definition at line 149 of file superblock.c.
| uint16_t free_inode | ( | const struct superblock * | superblock, |
| uint16_t | inode_id | ||
| ) |
Release inode.
| superblock | |
| inode_id | id of inode to release |
Definition at line 128 of file superblock.c.
| void init_super_block | ( | struct superblock * | superblock | ) |
Constructor of superblock.
Construct superblock with default params defined in core/defines.h
| superblock |
Definition at line 29 of file superblock.c.
| ssize_t read_super_block | ( | int | fd, |
| struct superblock * | superblock | ||
| ) |
Read sb from memory.
| fd | opened fd |
| superblock | empty instance of superblock |
Definition at line 47 of file superblock.c.
| uint16_t reserve_block | ( | const struct superblock * | superblock | ) |
Reserve block.
| superblock |
Definition at line 138 of file superblock.c.
| uint16_t reserve_inode | ( | const struct superblock * | superblock | ) |
Reserve free inode.
| superblock |
Definition at line 117 of file superblock.c.
| size_t sizeof_superblock | ( | const struct superblock * | superblock | ) |
Count blocks_count_in_inode of inode in bytes
| superblock |
Definition at line 23 of file superblock.c.
| ssize_t write_super_block | ( | int | fd, |
| struct superblock * | superblock | ||
| ) |
Write sb to memory.
| fd | opened fd |
| superblock |
Definition at line 85 of file superblock.c.
1.8.6