linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
To: Alberich de megres <alberich2k5@gmail.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: root dir
Date: Mon, 09 Feb 2009 16:05:04 -0600	[thread overview]
Message-ID: <1234217104.7851.4.camel@norville.austin.ibm.com> (raw)
In-Reply-To: <12d708830902090554n397ad6aeye1d9d60660f4553f@mail.gmail.com>

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


  reply	other threads:[~2009-02-09 22:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-09 13:54 root dir Alberich de megres
2009-02-09 22:05 ` Dave Kleikamp [this message]
2009-02-10 12:18   ` Alberich de megres
2009-02-10 12:30     ` Dave Kleikamp
2009-02-10 12:33       ` Manish Katiyar
2009-02-11 21:45         ` Alberich de megres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1234217104.7851.4.camel@norville.austin.ibm.com \
    --to=shaggy@linux.vnet.ibm.com \
    --cc=alberich2k5@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).