* Which fs is a good example for learning ?
@ 2009-01-05 20:40 Francis Moreau
2009-01-05 20:59 ` Matthew Wilcox
0 siblings, 1 reply; 8+ messages in thread
From: Francis Moreau @ 2009-01-05 20:40 UTC (permalink / raw)
To: linux-fsdevel
Hello,
I'd like to learn how file systems work on Linux and I don't know
which file system driver I should look at to get a good picture of
how a contemporary file system is designed.
The choice has to be made according some criterias: the fs shouldn't
be too hard since I'm pretty new in this area. Also not too
old/obsolete since I'd like to learn from current technology.
Could anybody give me some suggestions ?
Thanks
--
Francis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-05 20:40 Which fs is a good example for learning ? Francis Moreau
@ 2009-01-05 20:59 ` Matthew Wilcox
2009-01-06 6:23 ` Avishay Traeger
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Matthew Wilcox @ 2009-01-05 20:59 UTC (permalink / raw)
To: Francis Moreau; +Cc: linux-fsdevel
On Mon, Jan 05, 2009 at 09:40:50PM +0100, Francis Moreau wrote:
> I'd like to learn how file systems work on Linux and I don't know
> which file system driver I should look at to get a good picture of
> how a contemporary file system is designed.
>
> The choice has to be made according some criterias: the fs shouldn't
> be too hard since I'm pretty new in this area. Also not too
> old/obsolete since I'd like to learn from current technology.
You're giving some contradictory criteria. ext2 is probably the best
example to learn the basics, then you can move on to whichever
filesystem catches your fancy.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-05 20:59 ` Matthew Wilcox
@ 2009-01-06 6:23 ` Avishay Traeger
2009-01-06 8:46 ` Francis Moreau
[not found] ` <c41302d20901052214j56a34b38h3a89f94b540be006@mail.gmail.com>
2 siblings, 0 replies; 8+ messages in thread
From: Avishay Traeger @ 2009-01-06 6:23 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: Francis Moreau, linux-fsdevel
On Mon, Jan 5, 2009 at 10:59 PM, Matthew Wilcox <matthew@wil.cx> wrote:
>
> On Mon, Jan 05, 2009 at 09:40:50PM +0100, Francis Moreau wrote:
> > I'd like to learn how file systems work on Linux and I don't know
> > which file system driver I should look at to get a good picture of
> > how a contemporary file system is designed.
> >
> > The choice has to be made according some criterias: the fs shouldn't
> > be too hard since I'm pretty new in this area. Also not too
> > old/obsolete since I'd like to learn from current technology.
>
> You're giving some contradictory criteria. ext2 is probably the best
> example to learn the basics, then you can move on to whichever
> filesystem catches your fancy.
This is all a matter of opinion obviously, but I would personally
start with ramfs - it's only a couple hundred lines of code, and is
very simple since everything resides only in memory. This is useful
for looking at the API and code flow. Then you can go to a disk-based
file system like ext2 which is a bit more complex but closer to what
you're probably looking for.
Avishay
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-05 20:59 ` Matthew Wilcox
2009-01-06 6:23 ` Avishay Traeger
@ 2009-01-06 8:46 ` Francis Moreau
2009-01-06 13:36 ` Matthew Wilcox
[not found] ` <c41302d20901052214j56a34b38h3a89f94b540be006@mail.gmail.com>
2 siblings, 1 reply; 8+ messages in thread
From: Francis Moreau @ 2009-01-06 8:46 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-fsdevel
Hello,
On Mon, Jan 5, 2009 at 9:59 PM, Matthew Wilcox <matthew@wil.cx> wrote:
> On Mon, Jan 05, 2009 at 09:40:50PM +0100, Francis Moreau wrote:
>> I'd like to learn how file systems work on Linux and I don't know
>> which file system driver I should look at to get a good picture of
>> how a contemporary file system is designed.
>>
>> The choice has to be made according some criterias: the fs shouldn't
>> be too hard since I'm pretty new in this area. Also not too
>> old/obsolete since I'd like to learn from current technology.
>
> You're giving some contradictory criteria. ext2 is probably the best
> example to learn the basics, then you can move on to whichever
> filesystem catches your fancy.
>
OK.
That's what I think too but wasn't sure ext2 is still a good choice since it's
pretty old and it looks like some younger fs seems to make ext2 obsolete.
Also, it doesn't have a journal.
thanks.
--
Francis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
[not found] ` <c41302d20901052214j56a34b38h3a89f94b540be006@mail.gmail.com>
@ 2009-01-06 8:49 ` Francis Moreau
2009-01-06 11:44 ` Jamie Lokier
0 siblings, 1 reply; 8+ messages in thread
From: Francis Moreau @ 2009-01-06 8:49 UTC (permalink / raw)
To: Avishay Traeger; +Cc: Matthew Wilcox, linux-fsdevel
On Tue, Jan 6, 2009 at 7:14 AM, Avishay Traeger <avishay@gmail.com> wrote:
> On Mon, Jan 5, 2009 at 10:59 PM, Matthew Wilcox <matthew@wil.cx> wrote:
>>
>> On Mon, Jan 05, 2009 at 09:40:50PM +0100, Francis Moreau wrote:
>> > I'd like to learn how file systems work on Linux and I don't know
>> > which file system driver I should look at to get a good picture of
>> > how a contemporary file system is designed.
>> >
>> > The choice has to be made according some criterias: the fs shouldn't
>> > be too hard since I'm pretty new in this area. Also not too
>> > old/obsolete since I'd like to learn from current technology.
>>
>> You're giving some contradictory criteria. ext2 is probably the best
>> example to learn the basics, then you can move on to whichever
>> filesystem catches your fancy.
>
> This is all a matter of opinion obviously, but I would personally start with
> ramfs - it's only a couple hundred lines of code, and is very simple since
> everything resides only in memory. This is useful for looking at the API
> and code flow. Then you can go to a disk-based file system like ext2 which
> is a bit more complex but closer to what you're probably looking for.
>
ramfs seems a good example for learning the page cache. But since it's not
a disk based filesystem, it doesn't cover the block dev layer (bio, elevator...)
and more important all data structures used on the disk.
thanks
--
Francis
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-06 8:49 ` Francis Moreau
@ 2009-01-06 11:44 ` Jamie Lokier
0 siblings, 0 replies; 8+ messages in thread
From: Jamie Lokier @ 2009-01-06 11:44 UTC (permalink / raw)
To: Francis Moreau; +Cc: Avishay Traeger, Matthew Wilcox, linux-fsdevel
Francis Moreau wrote:
> ramfs seems a good example for learning the page cache. But since
> it's not a disk based filesystem, it doesn't cover the block dev
> layer (bio, elevator...) and more important all data structures
> used on the disk.
Fair enough, that's good stuff to understand.
Btw, only about half the filesystems in linux/fs use the block dev
layer and work with block based disks.
The others are virtual, userspace, network, flash or (being submitted)
object-storage.
-- Jamie
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-06 8:46 ` Francis Moreau
@ 2009-01-06 13:36 ` Matthew Wilcox
2009-01-06 14:30 ` Francis Moreau
0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2009-01-06 13:36 UTC (permalink / raw)
To: Francis Moreau; +Cc: linux-fsdevel
On Tue, Jan 06, 2009 at 09:46:04AM +0100, Francis Moreau wrote:
> That's what I think too but wasn't sure ext2 is still a good choice since it's
> pretty old and it looks like some younger fs seems to make ext2 obsolete.
> Also, it doesn't have a journal.
This is all true. It depends what your real goal is here. If you want
to learn the fundamentals of what a filesystem has to do to get blocks
from disc and turn them into files, ext2 is perfect for your needs
since it _doesn't_ have a journal or btrees or any of that fancy stuff.
You can learn that later once you have the principles down.
If your goal is to learn how an advanced filesystem works, you might want
to consider looking at JFS which has journals, extents, acls, xattrs and
so on. It's around 4x as big as ext2, but then it's also about 1/3 the
size of XFS (just in terms of wc -l). It's also been properly ported
to Linux, unlike XFS which is still full of IRIXisms.
--
Matthew Wilcox Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Which fs is a good example for learning ?
2009-01-06 13:36 ` Matthew Wilcox
@ 2009-01-06 14:30 ` Francis Moreau
0 siblings, 0 replies; 8+ messages in thread
From: Francis Moreau @ 2009-01-06 14:30 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: linux-fsdevel
On Tue, Jan 6, 2009 at 2:36 PM, Matthew Wilcox <matthew@wil.cx> wrote:
> On Tue, Jan 06, 2009 at 09:46:04AM +0100, Francis Moreau wrote:
>> That's what I think too but wasn't sure ext2 is still a good choice since it's
>> pretty old and it looks like some younger fs seems to make ext2 obsolete.
>> Also, it doesn't have a journal.
>
> This is all true. It depends what your real goal is here. If you want
> to learn the fundamentals of what a filesystem has to do to get blocks
> from disc and turn them into files, ext2 is perfect for your needs
> since it _doesn't_ have a journal or btrees or any of that fancy stuff.
> You can learn that later once you have the principles down.
>
If most of the fs use the same techniques as ext2 to get blocks from disk
then indeed ext2 is still a good candidate.
> If your goal is to learn how an advanced filesystem works, you might want
> to consider looking at JFS which has journals, extents, acls, xattrs and
> so on. It's around 4x as big as ext2, but then it's also about 1/3 the
> size of XFS (just in terms of wc -l). It's also been properly ported
> to Linux, unlike XFS which is still full of IRIXisms.
OK. I'll look at JFS if I'm still motivated after looking at ext2.
Thanks for the tips.
--
Francis
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-06 14:30 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-05 20:40 Which fs is a good example for learning ? Francis Moreau
2009-01-05 20:59 ` Matthew Wilcox
2009-01-06 6:23 ` Avishay Traeger
2009-01-06 8:46 ` Francis Moreau
2009-01-06 13:36 ` Matthew Wilcox
2009-01-06 14:30 ` Francis Moreau
[not found] ` <c41302d20901052214j56a34b38h3a89f94b540be006@mail.gmail.com>
2009-01-06 8:49 ` Francis Moreau
2009-01-06 11:44 ` Jamie Lokier
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).