On Thu, 2003-08-28 at 07:37, sundeep saini wrote:
> hi,
> I have a query about about JFS inode and directory structure.Actually
> i am newbie in JFS.so please help me.
> 1) My query is when i make some directories under some directory.If
> they are 8 or less then 8 .they stored in the inode.If i increase no.
> of entries then then directory inode became full and it allocates new
> leaf.in that new leaf all previous entries are copied and new
> directories are also stored.
> I have noted that after 8 entries in the leaf node there is some space
> freed about 128 bytes every time.is is any index or any thing else.I
> am unable to understand these bytes.

I'm don't understand what bytes you are talking about.  I don't know of
any space being freed.

> 2)I am also getting confused in 2nd half of the inode.96 bytes after
> the base area of inode.when i repeat the above case, i mean i make
> 10-15 directory entries and leaf node created.then what values are
> stored in the inode's union structure(128-223 bytes offset)
> Please help me .

This part is a little confusing, but I'll try to explain it.

In order that directory listings (i.e. readdir) can be resumed at the
right spot via a persistent offset, each directory entry has an index
associated with it.  The 96 bytes you are asking about contain the root
of an xtree that describes an array indexed by this index.  This array
points back into the dtree to the entry associated with the index.  If
the entry has been deleted, it contains the index of the next entry at
the time it was deleted.  This allows readdir to resume at the correct
location even when the directory has been modified.

When the size of the table is small enough, those 96 bytes contain the
table itself rather than an xtree root.  Since readdir's may resume at
any time after an entry has been deleted, the table never shrinks unless
we remove every entry, in which case the entire table is thrown away.

The directory inode's size reflect the size of this index table.  The
number of blocks refers to the blocks in both the table and in the
dtree.  The space within the inode is not reflected in i_blocks.

Historical note:  The original disk layout did not contain this index
table.  In OS/2, directory listing were resumed using the entire file
name, so the index was not necessary.  This structure was added in early
JFS-linux development and was the source of many bugs for a while.

I hope this helps clear up some of the confusion.

Thanks,
Shaggy

>  
> with best regards
> Sundeep Saini

_______________________________________________
Jfs-discussion mailing list
[EMAIL PROTECTED]
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jfs-discussion

Reply via email to