Re: Adding to struct file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jan 10, 2005 at 23:01:49 -0800, Can Sar wrote:
> I need to keep some information (just a number) for every open file in 
> the system and thought that this could be most easily done by adding an 
> integer field to the end of struct file. However, when doing this, I 
> get all kinds of weird bugs with modules and then the kernel dies. Any 
> suggestions to why this could be happening? I've had this problem in 
> the past when adding things to structs, and I always add it to the end.
> I would be glad about anything you could think of.

If you have actualy read the structure, you would have known, that it
contains a generic pointer field (called private_data, which, I hope, is
clear enough). Just abuse it for anything you want.

As for adding fields to structs, are you actualy sure, that all code,
and especialy the code setting up the kmem_caches, used the same
definition of the struct?

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@xxxxxx>

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux