[Libsysio-commit] HEAD: libsysio/include inode.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-09-21 20:12:58
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14759/include Modified Files: inode.h Log Message: - No longer maintain a list of all pnodes in the system. + Introduce a list of idle pnodes for use by the garbage collector. Index: inode.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/inode.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -w -b -B -p -r1.33 -r1.34 --- inode.h 21 Sep 2007 19:41:37 -0000 1.33 +++ inode.h 21 Sep 2007 20:12:55 -0000 1.34 @@ -259,7 +259,7 @@ struct pnode { struct mount *p_mount; /* mount info */ struct pnode *p_cover; /* covering pnode */ LIST_ENTRY(pnode) p_links; /* other aliases */ - TAILQ_ENTRY(pnode) p_nodes; /* all nodes links */ + TAILQ_ENTRY(pnode) p_idle; /* idle list links */ }; /* @@ -267,9 +267,8 @@ struct pnode { */ #define P_REF(pno) \ do { \ - TAILQ_REMOVE(&_sysio_pnodes, (pno), p_nodes); \ - TAILQ_INSERT_TAIL(&_sysio_pnodes, (pno), p_nodes); \ - (pno)->p_ref++; \ + if (!(pno)->p_ref++) \ + TAILQ_REMOVE(&_sysio_idle_pnodes, (pno), p_idle); \ assert((pno)->p_ref); \ } while (0) @@ -279,7 +278,8 @@ struct pnode { #define P_RELE(pno) \ do { \ assert((pno)->p_ref); \ - --(pno)->p_ref; \ + if (!--(pno)->p_ref) \ + TAILQ_INSERT_TAIL(&_sysio_idle_pnodes, (pno), p_idle); \ } while (0) /* @@ -487,7 +487,7 @@ struct ioctx { extern struct pnode *_sysio_root; extern TAILQ_HEAD(inodes_head, inode) _sysio_inodes; -extern TAILQ_HEAD(pnodes_head, pnode) _sysio_pnodes; +extern TAILQ_HEAD(pnodes_head, pnode) _sysio_idle_pnodes; extern int _sysio_i_init(void); #ifdef ZERO_SUM_MEMORY |