From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Kleikamp Subject: Re: root dir Date: Mon, 09 Feb 2009 16:05:04 -0600 Message-ID: <1234217104.7851.4.camel@norville.austin.ibm.com> References: <12d708830902090554n397ad6aeye1d9d60660f4553f@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org To: Alberich de megres Return-path: Received: from e8.ny.us.ibm.com ([32.97.182.138]:44966 "EHLO e8.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752347AbZBIWFG (ORCPT ); Mon, 9 Feb 2009 17:05:06 -0500 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e8.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n19LwKxw025569 for ; Mon, 9 Feb 2009 16:58:20 -0500 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id n19M55Y7192938 for ; Mon, 9 Feb 2009 17:05:05 -0500 Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n19M559f020698 for ; Mon, 9 Feb 2009 17:05:05 -0500 In-Reply-To: <12d708830902090554n397ad6aeye1d9d60660f4553f@mail.gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, 2009-02-09 at 14:54 +0100, Alberich de megres wrote: > Hello, > > I'm making my firsts steps with vfs and filesystem playground. > > I created a very simple fs, for wich i have a rude mkfs and its > fill_super function on kernel side. fill_super finish ok, and loadas > the super block for my filesystem, but when i make mount -t testfs > /dev/sdb1 /mnt/tfs i got the following message: "mount: not a > directory" fill_super() needs to at least allocate an inode and dentry for the root inode and assign sb->s_root to point to the root dentry. > And here comes my question: what vfs is supposed to do since it loads > sb and tries to list dir content? and what functions vfs needs at > least to mount my fs? ( just load it, and display an empty dir with > ls, not creating files etc... ) > The root inode needs to have file operations (i_fop) that include a readdir() method and probably one for llseek() (generic_file_llseek should be sufficient). If you haven't already found it, you probably want to take a look at http://www.geocities.com/ravikiran_uvs/articles/rkfs.html Shaggy -- David Kleikamp IBM Linux Technology Center