[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2008-07-11 16:48:06
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8234/include Modified Files: inode.h Log Message: Added per-directory name cache, replacing the global names cache. This involved: 1) Adding a root node for the binary tree to the path_base record. 2) Removing the global names cache from inode.c 3) Altering the implementation of ncache_{insert,delete} to use the parent node's names root as root. 4) Altering ncache_lookup to take the parent node and use it's root to find the key. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -w -b -B -p -r1.39 -r1.40 --- inode.h 17 Jun 2008 17:18:57 -0000 1.39 +++ inode.h 11 Jul 2008 16:48:01 -0000 1.40 @@ -272,6 +272,7 @@ struct qstr { struct pnode_base { mutex_t pb_mutex; /* record mutex */ unsigned pb_lckcnt; /* # recursive locks */ + struct tree_node *pb_ncache; /* names cache */ struct tree_node pb_tentry; /* cache node entry */ struct pnode_base_key { struct qstr pbk_name; /* entry name */ @@ -293,6 +294,7 @@ struct pnode_base { do { \ mutex_init(&(_pb)->pb_mutex, MUTEX_RECURSIVE); \ (_pb)->pb_lckcnt = 0; \ + (_pb)->pb_ncache = NULL; \ (_pb)->pb_tentry.tn_key = &(_pb)->pb_key; \ (_pb)->pb_tentry.tn_left = (_pb)->pb_tentry.tn_right = NULL; \ (_pb)->pb_key.pbk_name = *(_name); \ |