Changed how we write out superblock to use append

Making the superblock look like "just another entry" allows us to treat
the superblock like "just another entry" and reuse a decent amount of
logic that would otherwise only be used a format and mount time. In this
case we can use append to write out the superblock like it was creating
a new entry on the filesystem.
This commit is contained in:
Christopher Haster
2018-03-23 16:11:36 -05:00
parent 701e4fa438
commit d0e0453651
4 changed files with 45 additions and 51 deletions

5
lfs.h
View File

@@ -257,15 +257,10 @@ typedef struct lfs_dir {
typedef struct lfs_superblock {
struct lfs_disk_superblock {
uint8_t type;
uint8_t elen;
uint8_t alen;
uint8_t nlen;
lfs_block_t root[2];
uint32_t block_size;
uint32_t block_count;
uint32_t version;
char magic[8];
} d;
} lfs_superblock_t;