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

Re: Incorporating a small change in inode structure: please help

On Thu, Oct 28, 2004 at 04:27:49PM +0530, Kaustubh Ghosh wrote:
> 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.

Remember attributes ARE IN THE INODE!  This is the intended method
built into the design of the file system for extending/ adding meta
data.  This extension lets you insert data of any sane size.

Common uses include archive tools, versioning etc.

If you want to modify the inode structure you can....  but this is
sort of like shopping for yachts.  If you have to ask the price of a
yacht the odds are that you cannot afford it.

There is nothing preventing you from making a copy of the header file
and start changing things. I recommend you select a new name that
reflects the original, i.e. prepend the file name with kg1.  Then
rename and edit the structure any way you like. Again prepend all the
old functions, variable and structure names with kg1- or something
systematic.  You ARE building a new files system type (call it kg1 short
for Kaustubh Ghosh v1).  You can copy all the ext[23] files and modify
all the ext functions to be unique to your new FS.  You will need to
build your kg1 code into the kernel and all the necessary tools in
user space.  Do not confuse base line files system code.  What you are
doing will be no different than afs, xfs, reiser fs....

It is possible on a first pass to make your new FS identical to the
existing ext[23] files system in all regards except the name.  Then add

You should start with a spare partition on your test machine.  You can
start by building a binary for mkkg1fs (be sure to modify the fs
magic) then after including the kernel modules modify the mount
command to know about your new FS type.....  This will let you test
the new FS and tools.  Do not forget that grub and other bootstrap
tools know stuff about file systems.  Hint, keep /boot as ext[23]....

Have fun.

	T o m  M i t c h e l l 
	May your cup runneth over with goodness and mercy
	and may your buffers never overflow.

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