[haiku-development] ext3 Journal Design Considerations

  • From: Janito Ferreira Filho <jvffprog@xxxxxxxxxxx>
  • To: Haiku Development <haiku-development@xxxxxxxxxxxxx>
  • Date: Wed, 14 Apr 2010 02:36:51 +0000


I have a couple of questions regarding how to create a proper
 journal implementation. The first thing I'm not sure about is class 
inheritance. Is there anything in Haiku that recommends against it? 
Because I currently have a plan to use it for two things. The first 
would be for the Journal. I made a virtual function (MapBlock) that on 
the normal Journal class just return's it's argument. The idea is to 
allow the creation of an JournalInInode class (or something like that) 
that maps the block correctly to a file inside the volume. This way, I 
think I'm future-proofing for journals outside of the file system 
device. Do you think this is elegant, or just bloat?

The second 
use would also be for future-proofing for external journals. The idea is
 to "rename" the Volume class into "Ext3Volume", and have a parent 
generic "Volume" containing just basic functions (and a block cache). 
This allows me to initiate a Journal with two Volumes, one for the 
journal and one for the file system. Somehow I feel that this solution 
is somewhat less elegant. What does everyone think? Am I complicating 
things too much?

Another question, I was implementing the second 
recovery pass of the journal (finding revoke blocks) and I read in the 
Linux implementation that it uses a hash table. Should I follow this 
implementation, or try something else? I thought about initially just 
doing a simple linked list, and then later on choosing a proper cache 
technique, maybe even reusing something already in Haiku.

I'm not
 sure how responsible I must be for these kind of design decisions. 
However, I'd rather ask about everything to produce something that fits 
nicely inside Haiku. Also, I'll probably post the code somewhere 
tomorrow so everyone can see better how I'm doing things, and also 
criticize it.

One last thing, what's the usual semantics for an InitCheck function?

Any remarks, comments, opinions? Thanks in advance,

Hotmail: Powerful Free email with security by Microsoft.

Other related posts: