[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-08-31 21:38:42
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27009/include Modified Files: inode.h Log Message: The children of a directory are now maintained as a tree, instead of as a list. Along with this, the nasty resursive implementation of pb_prune is now a de-recursed implementation. This method is 1 to 1.5 percent slower than the previous list implementation in my tests. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.60 retrieving revision 1.61 diff -u -w -b -B -p -r1.60 -r1.61 --- inode.h 17 Aug 2009 22:56:45 -0000 1.60 +++ inode.h 31 Aug 2009 21:38:29 -0000 1.61 @@ -318,8 +318,8 @@ struct pnode_base { struct pnode_base *pbk_parent; /* parent */ } pb_key; struct inode *pb_ino; /* inode */ - LIST_HEAD(, pnode_base) pb_children; /* children if a dir */ - LIST_ENTRY(pnode_base) pb_sibs; /* links to siblings */ + struct tree_node *pb_children; /* children if a dir */ + struct tree_node pb_sib; /* sibling tree rec */ LIST_HEAD(, pnode) pb_aliases; /* aliases */ #ifdef I_ASSOCIATIONS LIST_ENTRY(pnode_base) pb_alinks; /* names to same ino */ @@ -342,7 +342,9 @@ struct pnode_base { (_pb)->pb_key.pbk_name = *(_name); \ (_pb)->pb_key.pbk_parent = (_parent); \ (_pb)->pb_ino = NULL; \ - LIST_INIT(&(_pb)->pb_children); \ + (_pb)->pb_children = NULL; \ + (_pb)->pb_sib.tn_key = (_pb); \ + (_pb)->pb_sib.tn_left = (_pb)->pb_sib.tn_right = NULL; \ LIST_INIT(&(_pb)->pb_aliases); \ } while (0) |