safe flash filesystem

Russ Dill Russ.Dill at asu.edu
Fri Jun 22 13:23:01 EDT 2001


Abraham vd Merwe wrote:

> Hi Russ!
> 
> 
>>If its just a config file, why make all this so complicated?
>>
>>struct node {
>>
>>	u32 magic;
>>	char valid;
>>	u32 version;
>>	u32 data_crc;
>>	u32 hdr_crc;
>>	char data[DATA_SIZE];
>>};
>>
> 
> Yes, this is something in the lines I was thinking of. But what complicates
> things is if you start taking things like avoiding damaged blocks into
> account, wear levelling (this is fairly easy to solve) and keeping the flash
> unfragmented.
> 
> 


if you only eraseblocks when you need to, you always have at least N-1 
eraseblocks of pevious data, (where N is the number of eraseblocks 
used). A CRC can be done after the store to see if the node written is 
ok, if not, write it again (in the next node). since its a small amount 
of data (maybe 4-8k) and written linearly, wear leveling and 
fragmentation is not a problem. Lets say 4 parameter blocks of 16k a 
peice are used, that would be 1 erase cycle per 8 configs written, this 
would allow 800,000 configs to be written on standard flash. If a config 
was written at a rate of once an hour, it would last 93 years. If it 
were on 2 128k standard blocks, then you wolud have 3.2M configs 
written, which at the same rate, would last about 332 years. Remember, 
you are only performing an erase cycle after a block fills up, not for 
every write.





More information about the linux-mtd mailing list