[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: read/write from kernel module
Hi,
I really appreciate for your help.
Since I am not reading/writing within an interrupt, it is relative easy
to do so and I've done it using filp_open() call. Following is my simple
code which is from fs/exec.c:kernel_read()
old_fs = get_fs();
set_fs(get_ds());
result = file->f_op->read(file, (caddr_t)addr, size, &pos);
set_fs(old_fs);
filp_close(file, NULL);
I will check to see the system call ways there.
Thanks,
-Haijin
-----------------------------------------------------------
static void live(byte food, short sleep, const double work)
{ for(;;)
future = NULL;
}
---------------------
On Thu, 1 May 2003, Raghu R. Arur wrote:
>
> Take a look at Making System Calls from kernel space at this site
>
> www.linux-mag.com/2000-11/gear_01.html
>
> You can call sys_read, sys_write directly from your module.
>
> HTH,
> raghu
>
> On Thu, 1 May 2003, Haijin Yan wrote:
>
> > Hi,
> > I have this kernel module, when I unload it, I want to save some meta
> > data to some place and read the meta in again when the next time I load
> > the module again. Since meta are huge, I can not pass them as parameters.
> > Coud I do kernel read/write file system? or any other ideas about how to
> > do it?
> >
> > Any comments is highly appreciated.
> >
> > Best,
> > -Haijin
> >
> >
> > --
> > Kernelnewbies: Help each other learn about the Linux kernel.
> > Archive: http://mail.nl.linux.org/kernelnewbies/
> > FAQ: http://kernelnewbies.org/faq/
> >
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/