[Libsysio-commit] HEAD: libsysio/src inode.c
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-09-21 20:12:58
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14759/src Modified Files: inode.c 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.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/inode.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- inode.c 21 Sep 2007 19:41:37 -0000 1.29 +++ inode.c 21 Sep 2007 20:12:55 -0000 1.30 @@ -93,9 +93,9 @@ static size_t desired_names = (3 * NAMES static size_t max_names; /* - * List of all path-nodes (aliases) referenced by any tree. + * List of all path-nodes (aliases) that are not currently referenced. */ -struct pnodes_head _sysio_pnodes; +struct pnodes_head _sysio_idle_pnodes; /* * The system root -- Aka `/'. @@ -122,7 +122,7 @@ _sysio_i_init() for (i = 0; i < NAMES_TABLE_LEN; i++) names[i] = NULL; - TAILQ_INIT(&_sysio_pnodes); + TAILQ_INIT(&_sysio_idle_pnodes); max_names = desired_names; @@ -335,7 +335,7 @@ p_reclaim(unsigned count) #ifdef I_STATS p_reclaims++; #endif - next = _sysio_pnodes.tqh_first; + next = _sysio_idle_pnodes.tqh_first; if (!next) return; t = n_names / 2; @@ -344,9 +344,9 @@ p_reclaim(unsigned count) p_examined++; #endif pno = next; - next = pno->p_nodes.tqe_next; + next = pno->p_idle.tqe_next; if (pno->p_ref) - continue; + abort(); if (pno->p_mount->mnt_root == pno) { /* * We never reclaim mount points, here. @@ -586,7 +586,6 @@ _sysio_p_new_alias(struct pnode *parent, pno->p_mount = mnt; pno->p_cover = NULL; LIST_INSERT_HEAD(&pb->pb_aliases, pno, p_links); - TAILQ_INSERT_TAIL(&_sysio_pnodes, pno, p_nodes); return pno; } @@ -600,7 +599,7 @@ _sysio_p_gone(struct pnode *pno) assert(!pno->p_ref); assert(!pno->p_cover); - TAILQ_REMOVE(&_sysio_pnodes, pno, p_nodes); + TAILQ_REMOVE(&_sysio_idle_pnodes, pno, p_idle); LIST_REMOVE(pno, p_links); free(pno); |