> >
> > Would it be possible to have the kernel execute modprobe when a non-
> > existant
> > device node is accessed?
> >
> > IE If an application attempts to access /dev/ppp could the kernel run
> > "modprobe /dev/ppp" directly (not through devfsd)?
> >
>
> Theoretically, yes. Doing this means that either every file system must
> support it in its ->lookup method or you need special file system type for
> /dev. The latter exists and is called devfs :) The former may be
> problematic
> because at the time ->lookup is called we do not have full pathname - just
> inode pointing to directory and single component inside this directory. So
> implementation may need to unwalk directory name (like sys_getcwd does,
> actually just call it) - and this for _every_ lookup. And almost for every
> file system type.
>
Correction - it is obviously possible to put it in
fs/namei.c:link_path_walk() & friends. If lookup failed, modprobe and
restart.
This is complicated because it can be relative pathname but then you could
compare mnt pointer in parent nd with mnt for /dev (to avoid path
unwalking).
-andrey
|