Re: Writing a VFS driver

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

 




On 7 Jan 2007, at 23:28, Avishay Traeger wrote:

On Sun, 2007-01-07 at 17:36 -0500, David H. Lynch Jr. wrote:

    I am looking for something really simple to start from, but also
something that actually uses an underlying block device.
    All the "tutorial" examples I have tripped over (rkfs, ols2006
samplefs) seem to impliment in memory filesystems - unless I
    am mis-understanding how VFS to block device mapping works.

You may want to look at cramfs (fs/cramfs), which is a read-only file
system that doesn't have much code to it.


I personally wouldn't look at Cramfs, althought it is a simple block device based filesystem, it has some elements such as compression, and non unique inode numbers that make it unnecessarily complicated for your needs.

I would personally use Romfs as a guide. This, although an old ilesystem, has all the elements you need. You don't mention whether your filesystem has unique inode numbers, but you can use the disk location of the inode to generate the inode number. Doing this ensures your inode numbers are unique, and you can use the standard VFS iget routine, which can use this inode number to go straight to the information on disk. You mention your filesystem aligns each inode on a 8 Kbyte boundary, however, the file data appears to follow immediately after the inode header, and hence this won't be aligned on a page boundary (4 Kbytes). Due to this you cannot use the generic read page function (block_read_full_page), however, ROMFS has this non-alignment issue and you can simply copy what it does.

Hope that helps.

Phillip

-
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