Re: PROBLEM: Accessing to file system functions inside the kernel

Grigory Lyahovitsky (grigory@7ka.mipt.ru)
Wed, 7 Jul 1999 17:50:25 +0400


Hello!

> > I'm sorry for repeating question, but I cuoldn't find any information about
> > subj... How can I access to some file (suppose config file) from the kernel
> > module??? Advice me any manual/doc/faq ... about this... Not a book
> > (like The Device Drivers), because I don't think that I can find it in Russia :(
>
> You should not do it. At all. Kernel module is not a process. It has no
> context. With some trickery you could work around that, but exporting all
> the stuff needed for work with files is not an option. Sorry. If you want
> to do it upon the initialization - make the real process feed the data to
> module.

Hmmm... It's really bad idea for working with config files... But, mainly I
want to do the next thing: I want to map some file as block device (i.e.
I want that /dev/??? file is appeared and it's content was identical to the
content of my file)... But, I solved this problem already by use
flip_open(..., ..., ...)->f_op->read/write. (BTW, is it normal way to use
file, or not???)

Thank you for help.

Bye...

-----------------------------------------
Lyahovitsky Grigory (grigory@7ka.mipt.ru)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/