From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Francis Moreau" Subject: Re: Which fs is a good example for learning ? Date: Tue, 6 Jan 2009 09:49:32 +0100 Message-ID: <38b2ab8a0901060049r18bb1d8do18a51ed4c3830ddf@mail.gmail.com> References: <20090105205945.GJ2002@parisc-linux.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Matthew Wilcox" , linux-fsdevel@vger.kernel.org To: "Avishay Traeger" Return-path: Received: from ug-out-1314.google.com ([66.249.92.175]:6914 "EHLO ug-out-1314.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751718AbZAFIte (ORCPT ); Tue, 6 Jan 2009 03:49:34 -0500 Received: by ug-out-1314.google.com with SMTP id 39so1521550ugf.37 for ; Tue, 06 Jan 2009 00:49:32 -0800 (PST) In-Reply-To: Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Jan 6, 2009 at 7:14 AM, Avishay Traeger wrote: > On Mon, Jan 5, 2009 at 10:59 PM, Matthew Wilcox 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