OK, here's a new patch ;)
regards,
Rik
-- Hollywood goes for world dumbination, Trailer at 11.http://www.surriel.com/ http://www.conectiva.com/ http://distro.conectiva.com.br/
--- linux-2.4.0-prerelease/include/linux/dcache.h.orig Wed Jan 3 16:33:43 2001 +++ linux-2.4.0-prerelease/include/linux/dcache.h Wed Jan 3 16:43:29 2001 @@ -115,6 +115,7 @@ * If this dentry points to a directory, then * s_nfsd_free_path semaphore will be down */ +#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ extern spinlock_t dcache_lock; --- linux-2.4.0-prerelease/fs/dcache.c.orig Wed Jan 3 16:33:09 2001 +++ linux-2.4.0-prerelease/fs/dcache.c Wed Jan 3 17:10:50 2001 @@ -339,10 +339,17 @@ if (tmp == &dentry_unused) break; - dentry_stat.nr_unused--; list_del_init(tmp); dentry = list_entry(tmp, struct dentry, d_lru); + /* If the dentry was recently referenced, don't free it. */ + if (dentry->d_flags & DCACHE_REFERENCED) { + dentry->d_flags &= ~DCACHE_REFERENCED; + list_add(&dentry->d_lru, &dentry_unused); + continue; + } + dentry_stat.nr_unused--; + /* Unused dentry with a count? */ if (atomic_read(&dentry->d_count)) BUG(); @@ -732,6 +739,7 @@ continue; } __dget_locked(dentry); + dentry->d_flags |= DCACHE_REFERENCED; spin_unlock(&dcache_lock); return dentry; }
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/