Re: root dir

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

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux