Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure superblock always fits SIMPLEFS_BLOCK_SIZE
In current implementation, the struct superblock used padding via subtraction to match the SIMPLEFS_BLOCK_SIZE, which could lead to the need for recalculating the padding when the data structure changed. This commit introduces a union that allocates the largest size among its members to set the struct superblock size, ensuring that it is at least SIMPLEFS_BLOCK_SIZE. Additionally, it utilizes the _Static_assert keyword to verify whether the size matches SIMPLEFS_BLOCK_SIZE.
- Loading branch information