Skip to content

Commit

Permalink
Refactor struct superblock for improved code clarity.
Browse files Browse the repository at this point in the history
This commit ensures that the padding size always matches the block
size defined by SIMPLEFS_BLOCK_SIZE.
  • Loading branch information
HotMercury committed May 7, 2024
1 parent a59b479 commit d7ab220
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mkfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
#include "simplefs.h"

struct superblock {
struct simplefs_sb_info info;
char padding[4064]; /* Padding to match block size */
union {
struct simplefs_sb_info info;
char padding[SIMPLEFS_BLOCK_SIZE]; /* Padding to match block size */
};
};

/**
Expand Down

0 comments on commit d7ab220

Please sign in to comment.