|
Basic Solution File System - BSFS
|
Represents a deleted file entry stored in the recovery B-tree. More...
#include <filesystem_bsfs.h>
Public Attributes | |
| uint32_t | recovery_id |
| uint64_t | deleted_at |
| uint32_t | original_parent_ino |
| char | original_name [256] |
| uint32_t | inode_number |
| uint8_t | file_type |
| uint16_t | uid |
| uint16_t | gid |
| uint16_t | permissions |
| uint32_t | file_size |
| uint32_t | block_count |
| bspan_t | direct_blocks [16] |
| uint32_t | btree_root |
| uint64_t | retention_until |
Represents a deleted file entry stored in the recovery B-tree.
Each recovery entry acts as a snapshot of a file's inode at the moment it was deleted. These entries enable the filesystem to restore deleted files without immediately freeing their data blocks. Recovery entries are stored in a dedicated B-tree, separate from the inode tree, and remain valid until they are purged manually or by retention policies.
| uint32_t rec_entry_t::block_count |
Number of blocks allocated to the file at deletion time.
| uint32_t rec_entry_t::btree_root |
Root block number of the B-tree containing additional block spans for large files. Preserved so that the full file data mapping can be recovered.
| uint64_t rec_entry_t::deleted_at |
Timestamp of when the file was deleted, in Unix time (seconds since epoch). Used for listing recovery entries chronologically and for retention checks.
| bspan_t rec_entry_t::direct_blocks[16] |
Snapshot of the inode's 16 direct block spans, pointing to the physical blocks used by the file. Preserved to allow block reuse during restoration.
| uint32_t rec_entry_t::file_size |
Total logical size of the file in bytes at deletion time.
| uint8_t rec_entry_t::file_type |
Type of the file at deletion (e.g., regular file, directory, symlink). Uses the same enum/constant values as inode_t::file_type.
| uint16_t rec_entry_t::gid |
Group ID of the file owner at deletion time.
| uint32_t rec_entry_t::inode_number |
Inode number of the deleted file. Can be reused when restoring the file to simplify consistency with previous references.
| char rec_entry_t::original_name[256] |
Original file name at deletion time. Used when restoring the file or displaying it in recovery listings.
| uint32_t rec_entry_t::original_parent_ino |
Inode number of the original parent directory where the file resided. Useful for restoring the file to its original location, if available.
| uint16_t rec_entry_t::permissions |
File permissions (e.g., 0755 format), copied from the inode at deletion.
| uint32_t rec_entry_t::recovery_id |
Unique identifier for this recovery entry, assigned sequentially or uniquely at deletion time. Used by user-facing recovery commands (e.g., listing and restoring deleted files).
| uint64_t rec_entry_t::retention_until |
Timestamp until which this recovery entry is retained, in Unix time. After this point, a garbage collector may safely purge the entry and release its data blocks back to the free space pool.
| uint16_t rec_entry_t::uid |
User ID of the file owner at deletion time.