2004-09-29 04:47:33

by Rakesh Jagota

[permalink] [raw]
Subject: opening a file inside the kernel module

Hi all,
I am working in linux, i would like to know abt whether can I open a file
inside the kernel module without using any application. If so how how the
files_struct will be maintained. Does a kernel module has this struct?

Waiting for any suggestion from the list.

Thanks in advance,
rakesh


2004-09-29 05:00:33

by Jeff Garzik

[permalink] [raw]
Subject: Re: opening a file inside the kernel module

Rakesh Jagota wrote:
> Hi all,
> I am working in linux, i would like to know abt whether can I open a file
> inside the kernel module without using any application. If so how how the
> files_struct will be maintained. Does a kernel module has this struct?

Don't do this. It's incompatible with namespaces.

Instead, figure out some way to pass the file contents to the kernel module.

Jeff


2004-09-29 05:54:48

by Rakesh Jagota

[permalink] [raw]
Subject: Re: opening a file inside the kernel module

Hi,
Thnx.

I want to implement socket from the module. I won't be having any user
process running to handle the descriptors coming from socket. Could you pl
tell me how to handle the socket descriptor from the kernel module.

Thanks,
rakesh
----- Original Message -----
From: "Jeff Garzik" <[email protected]>
To: "Rakesh Jagota" <[email protected]>
Cc: <[email protected]>; <[email protected]>;
<[email protected]>
Sent: Wednesday, September 29, 2004 10:30 AM
Subject: Re: opening a file inside the kernel module


> Rakesh Jagota wrote:
> > Hi all,
> > I am working in linux, i would like to know abt whether can I open a
file
> > inside the kernel module without using any application. If so how how
the
> > files_struct will be maintained. Does a kernel module has this struct?
>
> Don't do this. It's incompatible with namespaces.
>
> Instead, figure out some way to pass the file contents to the kernel
module.
>
> Jeff
>
>
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive: http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>

2004-09-29 15:54:57

by Stuart MacDonald

[permalink] [raw]
Subject: RE: opening a file inside the kernel module

From: [email protected]
> I want to implement socket from the module. I won't be having any user
> process running to handle the descriptors coming from socket.
> Could you pl
> tell me how to handle the socket descriptor from the kernel module.

Check out fs/smbfs/sock.c.

..Stu