Tuesday, October 18, 2005

Analyze This

This morning, I went through analyzing the BFS log area structure. Turns out it's very different from what I did for our BFS.
Our current log structure looks like this:

block 1 - n:
uint64 number of blocks
off_t[] array of block numbers
block n+1 - m:
real block data

While the one from BFS looks like this:

block 1:
uint32 number of runs
uint32 max. number of runs
block_run[] array of block runs
block 2 - m:
real block data

BFS only has one header block, so it can only store a certain number of blocks per log entry. On the other hand, it uses block runs instead of single block numbers which potentially compacts the size of the block array, but also makes lookups a lot more expensive.
Like a block number, a block run is 8 bytes wide, and is a composed data type that looks like this:

uint32 allocation_group;
uint16 start;
uint16 length;

BFS divides the whole volume into allocation groups - each of which can combine up to 65536 blocks. This way, it can also represent a number of sequential blocks. This structure is used a lot throughout BFS, so it's not surprising to find it again in the log area.

So I will now convert our BFS to use that same format, so that you can safely mount uncleanly unmounted volumes from both operating systems, BeOS and Haiku, and in both directions.

7 Comments:

At 1:56 PM, borg1980 said...

Keep up the great work. It's good to be well informed about HaikuOS :)

 
At 3:03 PM, ModeenF said...

Nice work :)

so are Be a better one? or does this depends on what we want to do with the OS?

 
At 5:29 PM, Axel Dörfler said...

The two versions are different, but pretty much equivalent. But I am almost through with making our BFS compatible in that regard as well, anyway.

 
At 9:34 PM, Alex Harvey said...

Maybe we should keep the way that is in the openbfs system for a new flavor of the BFS filesystem? BFS2 or something. Expanded version of BFS with changes.

 
At 12:02 AM, Unâm said...

All this story isn"t very clear to me =). I thought BFS was compatible with OBFS, I actually changed to OBFS my BFS partition a while ago so I thought both were compliants. Now I learn it is not, and I don't understand what's the use of going back at Be's way (except making peeps being able to boot from BFS IIUC).
Anyway, I'll trust you on that =)

 
At 12:09 AM, ryanknapper said...

I love you Alex.

 
At 3:19 AM, Fred said...

Hello there Axel Dörfler, I find reading blog articles like Analyze This most rewarding. It enhances the experiences of life in many cases.

Being a webmaster I tend to sometimes have a soft spot for blogs related to Superlinker and /or sites that are built around Superlinker type items.

Once again, thank you Axel Dörfler, and I will look for your posts again in the future. :-)

 

Post a Comment

<< Home