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

feat(free_bloc function added)

parent 61e7641c
No related branches found
No related tags found
No related merge requests found
...@@ -218,3 +218,15 @@ unsigned int new_bloc() ...@@ -218,3 +218,15 @@ unsigned int new_bloc()
return new_bloc; return new_bloc;
} }
void free_bloc(unsigned int bloc)
{
unsigned char buffer[sizeof(vblockchain_t)];
vblockchain_t blockchain;
blockchain.next = super.first_free;
super.first_free = bloc;
memcpy(buffer, &blockchain, sizeof(vblockchain_t));
write_bloc(super.id, bloc, buffer);
}
\ No newline at end of file
...@@ -63,5 +63,6 @@ void init_volume(unsigned int vol); ...@@ -63,5 +63,6 @@ void init_volume(unsigned int vol);
int load_super(unsigned int vol); int load_super(unsigned int vol);
void save_super(); void save_super();
unsigned int new_bloc(); unsigned int new_bloc();
void free_bloc(unsigned int bloc);
#endif #endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment