BUF/BIO - MPSAFE work on core buffer cache routines.
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 13 Jul 2009 22:57:53 +0000 (15:57 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 13 Jul 2009 22:57:53 +0000 (15:57 -0700)
commitb1c20cfa90fe1b1b6ab1a34b5ea98c33b5336ec9
treef9ddcef15548923148e831021539c0cbb779d427
parentc23609ad82e291baab33f00278178779488e60ce
BUF/BIO - MPSAFE work on core buffer cache routines.

Do initial MPSAFE work on getblk(), bread(), brelse(), bqrelse(),
biowait(), and friends.  Use get_mplock()/rel_mplock() in areas not
yet converted.

Add a flags argument to findblk() and have it return a locked buffer
cache buffer by default.  Callers may request that the buffer be
locked non-blocking, or that it not be locked at all.

Adjust all callers of findblk() for those cases where an unlocked
buffer is desired to lock and re-check the returned buffer's parameters,
since otherwise it can change out from under the caller whether a critical
section is used or not (for SMP).
13 files changed:
sys/kern/vfs_bio.c
sys/kern/vfs_cluster.c
sys/kern/vfs_lock.c
sys/kern/vfs_subr.c
sys/kern/vfs_sync.c
sys/sys/buf.h
sys/vfs/gnu/ext2fs/ext2_bmap.c
sys/vfs/hammer/hammer_io.c
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