Skip to content
Snippets Groups Projects
Commit 61c4848a authored by Thierno souleymane Bah's avatar Thierno souleymane Bah
Browse files

feat(load_super function added)

parent 42446ce8
No related branches found
No related tags found
No related merge requests found
......@@ -179,3 +179,13 @@ void init_volume(unsigned int vol)
write_bloc(vol, i, &blockchain);
}
}
int load_super(unsigned int vol)
{
unsigned char buffer[sizeof(vsuper_t)];
read_bloc(vol, SUPER_BLOC, buffer);
memcpy(&super, buffer, sizeof(vsuper_t));
assert(super.magic == MAGIC);
}
\ No newline at end of file
......@@ -40,6 +40,8 @@ typedef struct vsuper_s
unsigned int first_free;
} vsuper_t;
vsuper_t super;
typedef struct vblockchain_s
{
unsigned int next;
......@@ -58,5 +60,6 @@ void display_vols();
void remove_vol();
void init_volume(unsigned int vol);
int load_super(unsigned int vol);
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment