lkml.org 
[lkml]   [2000]   [Feb]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectVirtual mounts
I had an idea in the bath yesterday :-)

I had the idea of the 'virtual mount'. Basically you mount with -o virtual, and the vfs records
the mount details, then returns immediately. When the first non-stat operation is done on the mount
point, the mount actually happens.

I mostly implemented it last night... however I thought I'd better put my ideas down here so I can be shot down in
flames (or even encouraged) for having the idea in the first place. (It turned out to be much simpler than I thought,
although I haven't acctually attempted the mount-from-vfs yet...)

I have some questions:

What is best for allocating memory? vmalloc or kmalloc? I am storing the details in a linked list and each element is a couple of dozen bytes.

Where would be the best reference for implementing a /proc interface? (I envisige a client daemon that reads this to check how long each virtual mount has been 'idle' and triggers an unmount after a user-specified time. Actually this could just be a perl script....)

At the moment it's implemented like this... When the virtual mount is attempted it records the parameters to do_mount, and the dentry (after doing a dget()) of the mount point. It then marks the dentry. Then in lookup_dentry I check whether this is a virtual mount (the d_mounted entry is set to a magic value) and printk an 'I would do a mount here...' message.

This is the first time I've done anything 'big' to the Kernel, so I may have missed a lot of rather obvious stuff (anyway it was 2am and I was tired...)

Tony

--

"Now you too can enjoy having babies... start collecting today" (Recent advert)

tmh@magenta-logic.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:56    [W:0.413 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site