diff -urN 2.2.18pre17/fs/dcache.c dcache/fs/dcache.c --- 2.2.18pre17/fs/dcache.c Tue Jun 13 03:48:14 2000 +++ dcache/fs/dcache.c Tue Oct 24 15:33:32 2000 @@ -253,10 +253,15 @@ if (tmp == &dentry_unused) break; - dentry_stat.nr_unused--; list_del(tmp); - INIT_LIST_HEAD(tmp); dentry = list_entry(tmp, struct dentry, d_lru); + if (dentry->d_flags & DCACHE_REFERENCED) { + dentry->d_flags &= ~DCACHE_REFERENCED; + list_add(&dentry->d_lru, &dentry_unused); + continue; + } + dentry_stat.nr_unused--; + INIT_LIST_HEAD(tmp); if (!dentry->d_count) { i_nr -= prune_one_dentry(dentry); if (!i_nr) @@ -598,6 +603,7 @@ if (memcmp(dentry->d_name.name, str, len)) continue; } + dentry->d_flags |= DCACHE_REFERENCED; return dget(dentry); } return NULL; diff -urN 2.2.18pre17/include/linux/dcache.h dcache/include/linux/dcache.h --- 2.2.18pre17/include/linux/dcache.h Mon Oct 23 16:28:06 2000 +++ dcache/include/linux/dcache.h Tue Oct 24 15:33:13 2000 @@ -106,6 +106,10 @@ * If this dentry points to a directory, then * s_nfsd_free_path semaphore will be down */ +#define DCACHE_REFERENCED 0x0008 /* This dentry is been recently + * referenced so try to keep it in + * cache. + */ /* * d_drop() unhashes the entry from the parent