Replace the global buffer cache hash table with a per-vnode red-black tree.
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 5 Mar 2006 18:38:39 +0000 (18:38 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 5 Mar 2006 18:38:39 +0000 (18:38 +0000)
commit1f1ea522b5b3ee752ad73fca1c965b6937d2bf05
tree2d134f29b526b05bd47aba362a70385f3e74ff18
parentd9ba7ca95d6190f5867ec21d3f98746ae3fc45df
Replace the global buffer cache hash table with a per-vnode red-black tree.
Add a B_HASHED b_flags bit as a sanity check.  Remove the invalhash junk
and replace with assertions in several cases where the buffer must already
not be hashed.  Get rid of incore() and gbincore() and replace with a new
function called findblk().

Merge the new RB management with bgetvp(), the two are now fully integrated.

Previous work has turned reassignbuf() into a mostly degenerate call, simplify
its arguments and functionality to match.  Remove an unnecessary reassignbuf()
call from the NFS code.  Get rid of pbreassignbuf().

Adjust the code in several places where it was assumed that calling
BUF_LOCK() with LK_SLEEPFAIL after previously failing with LK_NOWAIT
would always fail.  This code was used to sleep before a retry.  Instead,
if the second lock unexpectedly succeeds, simply issue an unlock and retry
anyway.

Testing-by: Stefan Krueger <skrueger@meinberlikomm.de>
13 files changed:
sys/i386/i386/machdep.c
sys/kern/vfs_bio.c
sys/kern/vfs_cluster.c
sys/kern/vfs_lock.c
sys/kern/vfs_subr.c
sys/platform/pc32/i386/machdep.c
sys/sys/buf.h
sys/sys/vnode.h
sys/vfs/nfs/nfs_bio.c
sys/vfs/nfs/nfs_serv.c
sys/vfs/nfs/nfs_vnops.c
sys/vfs/ufs/ffs_softdep.c
sys/vfs/ufs/ufs_bmap.c