[haiku-development] Re: gsoc2010: File systems

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 26 Mar 2010 12:35:25 +0100

Janito Ferreira Filho <jvffprog@xxxxxxxxxxx> wrote:
> axeld@xxxxxxxxxxxxxxxx wrote:
> > I wouldn't bother with ext2 only write support - if you introduce 
> > logging as an afterthought, it has some unwanted effects (like the 
> > possibility to having to rewrite write support). Plus, logging can 
> > simplify implementing write support tremendously, as you don't have 
> > to 
> > care that much for the error case (the transaction API will take 
> > care 
> > of that for you mostly).
> I'm not yet fully familiar with how journaling is implemented, but if 
> I understood it
> correctly, I'll have to create a transaction API for handling the 
> write operations.
> The API would then (for ext2) be able to support a "no journaling" 
> option, which
> will bypass the journal writing operations and just use the defined 
> write method
> (meta data or data first). Am I on the right path?

Pretty much. If you do not actually fill a log, you don't have to take 
care about much else then using the transactional block cache API.

> > Just be aware that the file cache (and its API) currently does not 
> > support transactions; this is something that still needs to be 
> > implemented. Possibly by unifying the block and the file cache, and 
> > solving transactions using Copy-On-Write of the underlying VM.
> Then the problem would be interacting with the File Cache (and not 
> the
> Block Cache, as apparently the Block Cache has transaction support), 
> so
> that the transactions for file access can be correctly generated and 
> written.
> I haven't read anything about how the respective caches work. Am I 
> correct
> to assume that the File Cache interacts directly with the Block Cache?
> Would it be a big job to add transaction support to the File Cache? 

Unfortunately, the file and block caches have nothing in common right 
now. You as the file system creator have to take care that they get 
along together well; this works well in the case for BFS (which 
currently does not support file data logging), but probably won't work 
that well in the case of ext3.

> Also, I didn't understand the unification of the caches. Could you 
> explain a little more?

The file cache operates on cache objects of the virtual memory 
subsystem. This makes them very easy and efficient to use.
The block cache, however, does not. This has several drawbacks, but was 
easier and faster to implement (the cache API was part of my master 
thesis, so I was restricted in how much time I could spend on it).
Ideally, the block cache would be based on the VM as well, which would 
neatly solve the interaction with the file cache. The file cache would 
then be based upon the block cache, and the transaction support would 
be implemented already (in the backend, the API would still need to be 
updated).
However, this would be quite complicated and quite an effort to 
implement. That's why we didn't do it yet :-)
I would think this shouldn't be part of GSoC, though; unless you are 
already an expert on the subject, and familiar with Haiku, it would 
just take too long.

Maybe Ingo and I find some time to lay it out at least theoretically at 
BeGeistert.

> > It looks like a good project to me. You can work with the mentors 
> > to 
> > refine your initial application during the application period - 
> > while 
> > it should be well founded, it doesn't have to be perfect either, 
> > and 
> > can be adapted until the end.
> Thanks for your help =). I'm trying to understand as much as I can 
> before
> I start writing the application. Please forgive if I ask any 
> irrelevant questions
> or make any wrong assumptions. Still, I am very excited to work on 
> such project!

Well, be welcome, and don't hesitate to ask questions.
 
> > BTW please always remove unnecessary parts of the conversation.
> Okay. Sorry. Did I get it right this time? Please help me learn the 
> appropriate
> mailing-list etiquette. 

You did it right this time, indeed, and that's why I mention it :-)

> PS: BTW, I'm currently using as references the chapter on ext2/3 on
> "Understanding the Linux Kernel, 2nd ed.", and "UNIX Filesystems - 
> Evolution,
> Design and Implementation". Any comments or other recommendations?

I'm actually not familiar with those two books; I mostly read some 
online resources, and existing source code when writing the ext2 file 
system add-on.
For writing Haiku file systems, the file system API is at least 
documented not too badly in: http://api.haiku-os.org/fs_modules.html

HTH

Bye,
   Axel.


Other related posts: