Re: VFS implementation ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi:
First of all .. thanks Jason .. you've been very helpful (both technically and psychologically :) ) .. a VFS implementation is really a new idea to me and just have some partial time over two months to get is done
Anyway .. hearing that someone has experienced something like what i'm facing now makes it easier to face the problem
i've heared that the ext2 fs is somehow a little bit complicated to start with so i'll take your advice and i'll get some knowledge about BFS
well .. what i knew about sb is that it contains the basic information about fs geometry on disk, free spaces, allocated spaces .. and so on .. the problem with it is that my parallel fs i'm working on does not manage the low level details by it self .. it relies on the local fs of the cluster's nodes for managing low level block details for file storing and on a database for the directory structures ... so i find the superblock concept misty in my case .. so what the sb could be in my case ?


No problem :) Hope that this info is useful to you!! If you are
interested, I would not mind sharing progress. We can help each other
conquer VFS.


Thank you again it's kind of you .. i'll try to get some experience with the issue and get use of your advices and i'll get back to you soon
MHD



Jason J. Herne wrote:

I don't know if you are discussing such topics about file systems



Kernel level file systems have been discussed on this list before. I don't see why anyone would have an issue with this :)



I'm working on a semester project


I'm also working on a Linux file system implementation, but its for a masters thesis. I'm thinking that a semester won't be enough time for you to learn what you need to learn and get a file system implemented.



I've read about VFS in the "Understanding the Linux kernel" book .. and i've understand some of the ideas .. but each alone and the connection points between these ideas are lost



I've experienced the same thing after reading several chapters/books on VFS. :-( I think that any good VFS tutorial should walk the user through the simplest possible example. I am working on a very simple file system for the purposes of learning the VFS right now. When I complete it, I plan to create a "VFS Howto" or tutorial of sorts. :-D



can anyone help me by telling me from where to start ?


Well, you *could* start by looking at some of the ext2 code, or the BFS code.. I heard JFS is very simple and easy to understand. I find that before I can embark on any kernel related coding project, I usually have to spend a few hours at lxr (http://lxr.linux.no) browsing and reading over code to get a sense for how things work. If you've never heard of lxr, it is ABSOLUTELY indispensable!! :-)

If you want to look at BFS, here are some pointers to get your started:

http://lxr.linux.no/source/fs/bfs/
http://lxr.linux.no/source/fs/bfs/inode.c

inode.c contains MOST of the code, including the module load/unload
code.  You'll need to understand how kernel modules work before you can
write an FS.  Here is a resource for modules.  They have a guide fo the
2.4 kernel and the 2.6 kernel, both seem excellent!!

http://www.tldp.org/LDP/lkmpg/


After you get the module loading/unloading code written and compiling you'll need to register your FS with the kernel. This involves creating your own 'file_system_type' struct and registering it with 'register_filesystem'. Looking at BFS should make this clear.

After that, there are lots of things you can do.  I'm choosing to write
the code for my get_sb() function which is supposed to obtain/create the
VFS superblock given a block device.

One of the hardest things about creating an FS (at least from what I've
seen so far) is that at this point, you really have to have almost
everything coded in order to test it and see what is going on.  You
can't JUST read the SB and try to test it, because the kernel will want
inodes and dentry's for the root directory and whatnot.  My current plan
of action is to try and 'fake' a get_sb() function and the method
dealing with inodes and dentry's in a way that makes the root of my FS
look empty.  This way, I can at least add code incrementally from there
and have some method of testing and actually seeing what is going on.



Another question: It seemed to me that the VFS is not just an interface but there are some implemented parts in the VFS already exists, these parts have a generic form so it'll work with all file systems .. I don't know if this is right,



This is correct. VFS does have generic implementations for some functions. These are mostly functions that work pretty much the same for all FS's. In some cases you'll find you have to create your own, in others you'll be able to use the VFS provided functions. I can't give you too much advice about this YET, as I have not made it that far.



but if it was .. where can i find the source of the VFS so i can add my fs specific implementation issues ?



I don't know if diving into the VFS source is the best thing to do to get started. i think starting with existing FS code and learning to understand it and writing your own simple FS is the best way to start. But to answer your question, you can find VFS code here:

http://lxr.linux.no/source/include/linux/fs.h
http://lxr.linux.no/source/fs/filesystems.c
(not a complete list)




Thanks in advance



No problem :) Hope that this info is useful to you!! If you are interested, I would not mind sharing progress. We can help each other conquer VFS.





--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux