As I understand it your devlinks won't point to an inode, correct?
That means when you access /dev/fd0 the follow_link method for the
inode_operations needs to be called. It is this follow_link method
which is then doing the parsing. Then presumably you fiddle
base->d_inode->i_op->default_file_ops, correct?
You also need to support the readlink method, which will yield
"fd:0,format=360" or some such. This leads to the confusing situation
where:
open ("/dev/fd0", ...) works but
open ("/dev/fd:0,format=360") does not, even though
% ls -l /dev/fd0
lrwxrwxrwx 1 root root <date> /dev/fd0 => fd:0,format=360
"=>" is used by ls to show a devlink, rather than "->". It also
requires a modified ls. You may also need to modify other programmes
which have directory browsers. I guess GNU tar would also need
changes.
> > > Devlinks can be put anywhere the administrator wants, such as chroot
> > > jails, or devlinks in /tmp during a system installation.
> >
> > You can mount devfs N times.
>
> That's true. Devfs still needs more control mechanisms. If I set up a
> chroot jail, I want to have /dev/null in it, but I don't want to have
> my insmod'd printer driver popping up in there.
# mount -t devfs none /gaol/dev
# cd /gaol/dev
# rm -f lp* sd* hd* tty* pty* ...
(gaol == jail:-).
Regards,
Richard....