Index: src/fs-ecos.c =================================================================== RCS file: /cvs/ecos/ecos/packages/fs/jffs2/current/src/fs-ecos.c,v retrieving revision 1.27 diff -u -w -r1.27 fs-ecos.c --- src/fs-ecos.c 21 Apr 2004 18:51:21 -0000 1.27 +++ src/fs-ecos.c 12 Jul 2004 14:25:41 -0000 @@ -199,7 +199,9 @@ // held where needed for dotdot filepaths) while (this) { next = this->i_cache_next; - if (this != i && this->i_count == 0) { + if ( + //this != i && + this->i_count == 0) { struct _inode *parent = this->i_parent; if (this->i_cache_next) this->i_cache_next->i_cache_prev = this->i_cache_prev; @@ -1466,12 +1468,22 @@ { struct _inode *node = (struct _inode *) fp->f_data; + // cache values before we destroy the node + struct jffs2_sb_info *c = JFFS2_SB_INFO(node->i_sb); + struct _inode *root = node->i_sb->s_root; + D2(printf("jffs2_fo_close\n")); jffs2_iput(node); fp->f_data = 0; // zero data pointer + + // free as much of cached structures as possible to make sure + // that memory usage stays stable and that idle memory usage + // is at a minimum. + icache_evict(root, node); + return ENOERR; }