I’m trying to dinamically attach new devices and i would like to handle it
by ‘mount’ utility.
I could not find if mount supports other filesystems (may be i need to write
own dinamic library) and
when i try to use mount -T /dev/mydev (which is directory) i don’t see any
messages being sended to my resource manager.
Can anybody explain me that? I thought io-net works same.
Thank you in advance.
Andrey Andreev <andreev3@home.com> wrote:
I’m trying to dinamically attach new devices and i would like to handle it
by ‘mount’ utility.
I could not find if mount supports other filesystems (may be i need to write
own dinamic library) and
when i try to use mount -T /dev/mydev (which is directory) i don’t see any
messages being sended to my resource manager.
Can anybody explain me that? I thought io-net works same.
Yup I can explain it to you …
What you need to do is to attach a mount point to receive mount
messages. Even though the standard connect callout’s have a
mount callout, it isn’t invoked by default until you want to
perform a remount style operation.
In your resource manager you will want to add a line like the
following:
id = resmgr_attach(dpp, /* Standard dispatch handler *
&res_attr, /* Dispatch/Resource message attributes /
NULL, / Mount point NULL implies “/” /
_FTYPE_MOUNT,/ Mount type of messages /
/ We handle directories, but only _FTYPE_MOUNT dirs /
_RESMGR_FLAG_DIR | _RESMGR_FLAG_FTYPEONLY,
/ Your connect funcs and io_funcs, you can
choose to re-use your existing ones and key
off the handle or make specific ones that
only have the connect mount callout. If
you do have default ones then they will potentially
be called.
/
&connect_funcs, io_funcs,
/ Whatever you want to pass into your handle */
0 );
Now when a user runs mount:
% mount -T type special [mntpoint]
What you will get is a mount message that comes in to your mount
handler with msg.connect.path of “mntpoint” (or “” if mntpoint is
omited on the command line) and a type of “type” and a special
device of “special”. NOTE: Due to a bug in the current mount
utility the “special” string is coming in as the msg.connect.path
in the case where the mntpoint is omited.
Optionally you can also do
% mount -t type [special] mntpoint