* root dir
@ 2009-02-09 13:54 Alberich de megres
2009-02-09 22:05 ` Dave Kleikamp
0 siblings, 1 reply; 6+ messages in thread
From: Alberich de megres @ 2009-02-09 13:54 UTC (permalink / raw)
To: linux-fsdevel
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"
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... )
thanks!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: root dir
2009-02-09 13:54 root dir Alberich de megres
@ 2009-02-09 22:05 ` Dave Kleikamp
2009-02-10 12:18 ` Alberich de megres
0 siblings, 1 reply; 6+ messages in thread
From: Dave Kleikamp @ 2009-02-09 22:05 UTC (permalink / raw)
To: Alberich de megres; +Cc: linux-fsdevel
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: root dir
2009-02-09 22:05 ` Dave Kleikamp
@ 2009-02-10 12:18 ` Alberich de megres
2009-02-10 12:30 ` Dave Kleikamp
0 siblings, 1 reply; 6+ messages in thread
From: Alberich de megres @ 2009-02-10 12:18 UTC (permalink / raw)
To: Dave Kleikamp; +Cc: linux-fsdevel
thanks Dave :)
I didn't know about rkfs..
is there some other place that gives a deep loop to vfs?
and what about journaling?
:)
On Mon, Feb 9, 2009 at 11:05 PM, Dave Kleikamp
<shaggy@linux.vnet.ibm.com> wrote:
> 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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: root dir
2009-02-10 12:18 ` Alberich de megres
@ 2009-02-10 12:30 ` Dave Kleikamp
2009-02-10 12:33 ` Manish Katiyar
0 siblings, 1 reply; 6+ messages in thread
From: Dave Kleikamp @ 2009-02-10 12:30 UTC (permalink / raw)
To: Alberich de megres; +Cc: linux-fsdevel
On Tue, 2009-02-10 at 13:18 +0100, Alberich de megres wrote:
> thanks Dave :)
>
> I didn't know about rkfs..
>
> is there some other place that gives a deep loop to vfs?
Definitely take a look at Documentation/vfs.txt in the kernel source
tree. It contains some pointers to some not-quite-up-to-date articles
on writing file systems.
> and what about journaling?
I'm not sure what's out there.
> :)
Good luck!
Shaggy
--
David Kleikamp
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: root dir
2009-02-10 12:30 ` Dave Kleikamp
@ 2009-02-10 12:33 ` Manish Katiyar
2009-02-11 21:45 ` Alberich de megres
0 siblings, 1 reply; 6+ messages in thread
From: Manish Katiyar @ 2009-02-10 12:33 UTC (permalink / raw)
To: Dave Kleikamp; +Cc: Alberich de megres, linux-fsdevel
On Tue, Feb 10, 2009 at 6:00 PM, Dave Kleikamp
<shaggy@linux.vnet.ibm.com> wrote:
> On Tue, 2009-02-10 at 13:18 +0100, Alberich de megres wrote:
>> thanks Dave :)
>>
>> I didn't know about rkfs..
>>
>> is there some other place that gives a deep loop to vfs?
>
> Definitely take a look at Documentation/vfs.txt in the kernel source
> tree. It contains some pointers to some not-quite-up-to-date articles
> on writing file systems.
>
>> and what about journaling?
Being a newbie myself, I think the best way to understand journalling
would be to understand first its structure and then read jbd/jbd2
codepath. And to understand structure easiest thing is to read the
code of debugfs (which comes with e2fsprogs) or if you are comfortable
with C++ (unlike me :( ), read the source code of ext3grep.
Thanks -
Manish
>
> I'm not sure what's out there.
>
>> :)
>
> Good luck!
>
> 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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: root dir
2009-02-10 12:33 ` Manish Katiyar
@ 2009-02-11 21:45 ` Alberich de megres
0 siblings, 0 replies; 6+ messages in thread
From: Alberich de megres @ 2009-02-11 21:45 UTC (permalink / raw)
To: Manish Katiyar; +Cc: Dave Kleikamp, linux-fsdevel
I checked Documentation/fs/vfs.txt, rkfs..
But i hadn't any reference to file str, superblock str, and so on that
explains what its fields are for.. and cheking at the ext3 source code
i see some functions ( ie: do_sync_write ) that i didn't know where to
find info about ( without checking source code of this function ).
is there some place that explains this? or the only way is to check code?
thanks once again!
On Tue, Feb 10, 2009 at 1:33 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> On Tue, Feb 10, 2009 at 6:00 PM, Dave Kleikamp
> <shaggy@linux.vnet.ibm.com> wrote:
>> On Tue, 2009-02-10 at 13:18 +0100, Alberich de megres wrote:
>>> thanks Dave :)
>>>
>>> I didn't know about rkfs..
>>>
>>> is there some other place that gives a deep loop to vfs?
>>
>> Definitely take a look at Documentation/vfs.txt in the kernel source
>> tree. It contains some pointers to some not-quite-up-to-date articles
>> on writing file systems.
>>
>>> and what about journaling?
>
> Being a newbie myself, I think the best way to understand journalling
> would be to understand first its structure and then read jbd/jbd2
> codepath. And to understand structure easiest thing is to read the
> code of debugfs (which comes with e2fsprogs) or if you are comfortable
> with C++ (unlike me :( ), read the source code of ext3grep.
>
> Thanks -
> Manish
>
>>
>> I'm not sure what's out there.
>>
>>> :)
>>
>> Good luck!
>>
>> 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@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-11 21:45 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09 13:54 root dir Alberich de megres
2009-02-09 22:05 ` Dave Kleikamp
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
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).