On 05-08-08 07:51, Prasad Joshi wrote:
Thanks a lot Rene and Mark,
I am in a phase of learning the Linux Device Drivers. I am trying to
write a KDB module. This will add a new command in KDB to display the
registered filesystem specific data. Hence I need a way to read all the
registered filesystems.
Instead of exporting the function get_filesystem_list() and rebuilding
the kernel. I used the other function which is exported get_fs_type(char
*); ==> and in the first call to it I passed sysfs (which is the first
filesystem registerd, atleast on my machine.)
I got a pointer of type file_system_type and then onwards followed the
linklist to get the list of other filesystems registerd.
Well, that's not really a lot of use other than as a quick hack I'm
afraid. First, sysfs needn't even be compiled in, second, I doubt you
have any guarentee on ordering even if it is and third, you're racy.
See how get_filesystem_list() grabs a lock to make sure the list is not
changed while you're reading it. You can't provide that guarantee
without grabbing that same lock and you can't do that since it's local
to fs/filesystems.c.
You do need get_filesystem_list(). I have played around with kdb but it
was long ago. It does have parts which are compiled statically into the
kernel, does it not? If so and if this interface is intended to be more
than playground you could provide an indirect kdb interface there that
calls get_filesystem_list().
Rene.
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ