Incorporating a small change in inode structure: please help

Kaustubh Ghosh meetkaustubhghosh at vsnl.net
Thu Oct 28 10:57:49 UTC 2004


On Thursday 28 October 2004 02:18 am, you wrote:    
> On Wed, 2004-10-27 at 16:44, Nifty Hat Mitch wrote:
> > You might look at the mechanism that SELinux takes advantage of
> > extended attributes in the inode for your experiment.
> >
> > For example ls has the flags -Z and --lcontext.
> >     $ ls --lcontext /
> >     total 339
> >     drwxr-xr-x    6 system_u:object_r:default_t      root root   4096 Apr
> > 10  2004 b ....
> >
> > By taking advandage of existing extended atributes you will not break
> > the filesystem structure and the additional data is only
> > important when your kernel changes inspect, check, and modify
> > your attribute.
>
> Right, you likely don't need to add a field to the inode structure; you
> can already associate arbitrary data with an inode via the existing
> extended attribute support without requiring any changes to the kernel,
> on-disk format, etc.  'man 5 attr'


  First I want to thank all of you for your kind responce to my help plea. But 
inspite of all you say, I still want to add an extra field in the inode 
structure.Ofcourse I will have a spare machine to try it out.
Now following your instructions , what I found out is the ext2_inode structure 
definition.I was able to add my additional field to it.(Basically a simple 
integer array,one-dimention with index 30 or 40).I also identified some 
functions pertaining to inodes that I should change.But what I saw is that 
all functions use the struct inode *inode definition. But what I have is the 
ext2_inode definition.Evidently somewhere it must have been casted to inode. 
Basically what I need to do is to set all fields of my integer array to 0 
initially. Can you please point out where I am to do so .Thanks in advance.




More information about the fedora-list mailing list