LWN.net Logo

Advertisement

Advanced thin client solution for Linux, based on Open Source. Mix Windows and Linux applications on the same desktop.

Advertise here

Creating Linux virtual filesystems

Creating Linux virtual filesystems

Posted Oct 22, 2002 19:23 UTC (Tue) by gregkh (subscriber, #8)
Parent article: Creating Linux virtual filesystems

Nice article.

Unfortunatly, your module is not able to be unloaded, right (I'm guessing as I haven't tried the code myself)? Problem is that nothing is removing the files that you have created, forcing the module count to always remain positive.

To work around this, see the gyrations I had to do with get_mount and put_mount in the drivers/hotplug/pci_hotplug.c and drivers/usb/core/inode.c code. And patches to help port those two files to use libfs more are greatly appreciated :)


(Log in to post comments)

Creating Linux virtual filesystems

Posted Oct 22, 2002 19:50 UTC (Tue) by corbet (editor, #1) [Link]

Actually, it unloads just fine. Trust me, I loaded/unloaded it a lot of times before I was ready to write anything about it... Only had to reboot once, though :). I haven't followed it too far, but my understanding is that kill_litter_super() cleans up all of that junk at unmount time.

Creating Linux virtual filesystems

Posted Oct 22, 2002 22:13 UTC (Tue) by gregkh (subscriber, #8) [Link]

Ah, missed the kill_litter_super() reference, nice.

But does this mean that if you unmount the fs, and then mount it again, the "counter" file is created from scratch, with a initialized value?

If so, this might not be what you want for a fs that is tied to a driver. You might want to keep around the files between mounts, and not be forced to regenerate them all every mount time. This can be seen in usbfs where the files are created when a device is added or removed from the system. We don't walk all devices at mount time, although that might not be a bad idea...

Anyway, this is a minor point, very nice article, it matches my upcoming linux.conf.au talk and paper quite well :)

Oh, and for doing something like this for the 2.4 kernel, this article might help out a bit.

Creating Linux virtual filesystems

Posted Oct 23, 2002 0:41 UTC (Wed) by roelofs (subscriber, #2599) [Link]

So you wrote this article, Jonathan? That was a tad difficult to divine from the actual posting, even though you were the most likely suspect (as Kernel page editor and all)... Perhaps a subtitle or closing block or something with an attribution in the future? (Don't be shy about tooting your own horn, eh? You might consider naming a few names on the About page, too.)

Greg

Copyright © 2008, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds