On Sun, Jan 30, 2005 at 11:42:29AM +0200, yakoub abaya wrote:

> struct file repesents a proccess operating on a struct inode.
> each file has a private_data ,   as i've read this field will
> containe the struct we declare in the module code

That's the usual way of doing it.

> 1) but what if we declared two structs ? what about other
>    static variables we might declare ?

It is up to you to decide what (if anything) to open into
filp->private_data at open() time.

> 2) is it possible for all file operations methods
>     to operate on the same global struct declared in
>    the module code without using private_data ?

Yes, but it is not considered good design to have global data.

Chees, 
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

Attachment: signature.asc
Description: Digital signature

Reply via email to