Update of /cvsroot/libsysio/libsysio/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8837
Modified Files:
fs.c
Log Message:
The file system record now maintains the list of associated i-nodes as
a tree. This speeds up _sysio_i_find greatly when the names table cache
is allowed to become large.
Index: fs.c
===================================================================
RCS file: /cvsroot/libsysio/libsysio/src/fs.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -w -b -B -p -r1.16 -r1.17
--- fs.c 17 Jun 2008 17:18:57 -0000 1.16
+++ fs.c 26 Jul 2008 01:34:17 -0000 1.17
@@ -41,6 +41,7 @@
* le...@sa...
*/
+#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@@ -143,22 +144,18 @@ _sysio_fs_new(struct filesys_ops *ops, u
void
_sysio_fs_gone(struct filesys *fs)
{
- size_t n;
- struct itable_entry *head;
struct inode *ino;
if (fs->fs_ref)
abort();
- n = FS_ITBLSIZ;
- do {
- head = &fs->fs_itbl[--n];
- while ((ino = head->lh_first)) {
+ /*
+ * Destroy all remaining i-nodes in the per-FS cache.
+ */
+ while (fs->fs_icache) {
+ ino = TREE_ENTRY(fs->fs_icache, inode, i_tnode);
I_LOCK(ino);
I_GONE(ino);
}
- } while (n);
- if (n)
- abort();
(*fs->fs_ops.fsop_gone)(fs);
free(fs);
|