devfs
[Top] [All Lists]

RE: module loading

To: "'Russell Coker'" <russell@xxxxxxxxxxxx>, devfs@xxxxxxxxxxx
Subject: RE: module loading
From: Borzenkov Andrey <Andrey.Borzenkov@xxxxxxxxxxx>
Date: Thu, 27 Mar 2003 09:49:17 +0300
Importance: Normal
In-reply-to: <6134254DE87BD411908B00A0C99B044F03A0B68C@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: devfs-bounce@xxxxxxxxxxx
> >
> > 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


<Prev in Thread] Current Thread [Next in Thread>