Ok, it’s time to fix the ramdisk so that it supports mounts.
I understand that I have to use resmgr_attach with an _FTYPE_MOUNT,
and _RESMGR_FLAG_DIR | _RESMGR_FLAG_FTYPEONLY and with no name
if I want to at least see the mount requests.
That all works – I see the mount requests coming in to my io_mount()
handler…
What I’m confused about now is the relationship between the unnamed
resource just created, and the “block special device” that I feel
a need to create.
If I understand things correctly, I’ll need to create:
a) the unnamed device (as above)
b) the named special device (let’s say /dev/ramdisk)
Then, when a mount request comes in:
mount -T ramdisk /dev/ramdisk /home/user1
I will create another mountpoint at /home/user1.
I’m confused about the special device.
What should its attributes be? (block special?)
Does it need to have a mount() handler as well?
The confusion stems from the fact that it seems a little bit
redundant to have an unnamed device that’s then used to take
a special device name that then gets mounted – to my way
of thinking, I really want to create just the special device
/dev/ramdisk and have the user mount that where-ever they like.
But does that work with multiple mounts? I want to be able to:
mount -T ramdisk -omax=2M /dev/ramdisk /home/user1
mount -T ramdisk -omax=200M /dev/ramdisk /home/user2
to have several mountpoints for different ramdisks, each with
different options (in this case, for example, the max size).
Any suggestions?
Thanks in advance!
Cheers,
-RK
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Books, Video-based and Instructor-led
Training and Consulting at www.parse.com.
Email my initials at parse dot com.