summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>1999-06-26 02:47:16 +0000
committermckusick <mckusick@FreeBSD.org>1999-06-26 02:47:16 +0000
commit5b58f2f951911f1075788268f99efccf1dba60eb (patch)
tree3f01ed42f71231eaa6a8cfa08b267634f1923fb1 /sys/kern/kern_shutdown.c
parent3213b13650cb2206bbd62b5b1764d148750f63a0 (diff)
downloadFreeBSD-src-5b58f2f951911f1075788268f99efccf1dba60eb.zip
FreeBSD-src-5b58f2f951911f1075788268f99efccf1dba60eb.tar.gz
Convert buffer locking from using the B_BUSY and B_WANTED flags to using
lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
Diffstat (limited to 'sys/kern/kern_shutdown.c')
-rw-r--r--sys/kern/kern_shutdown.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/sys/kern/kern_shutdown.c b/sys/kern/kern_shutdown.c
index e01b815..52c3f29 100644
--- a/sys/kern/kern_shutdown.c
+++ b/sys/kern/kern_shutdown.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
- * $Id: kern_shutdown.c,v 1.51 1999/05/08 06:39:38 phk Exp $
+ * $Id: kern_shutdown.c,v 1.52 1999/05/12 22:30:46 peter Exp $
*/
#include "opt_ddb.h"
@@ -212,8 +212,8 @@ boot(howto)
for (iter = 0; iter < 20; iter++) {
nbusy = 0;
for (bp = &buf[nbuf]; --bp >= buf; ) {
- if ((bp->b_flags & (B_BUSY | B_INVAL))
- == B_BUSY) {
+ if ((bp->b_flags & B_INVAL) == 0 &&
+ BUF_REFCNT(bp) > 0) {
nbusy++;
} else if ((bp->b_flags & (B_DELWRI | B_INVAL))
== B_DELWRI) {
@@ -233,10 +233,11 @@ boot(howto)
*/
nbusy = 0;
for (bp = &buf[nbuf]; --bp >= buf; ) {
- if (((bp->b_flags & (B_BUSY | B_INVAL)) == B_BUSY) ||
- ((bp->b_flags & (B_DELWRI | B_INVAL))== B_DELWRI)) {
- if(bp->b_dev == NODEV)
- CIRCLEQ_REMOVE(&mountlist, bp->b_vp->v_mount, mnt_list);
+ if (((bp->b_flags&B_INVAL) == 0 && BUF_REFCNT(bp)) ||
+ ((bp->b_flags & (B_DELWRI|B_INVAL)) == B_DELWRI)) {
+ if (bp->b_dev == NODEV)
+ CIRCLEQ_REMOVE(&mountlist,
+ bp->b_vp->v_mount, mnt_list);
else
nbusy++;
}
@@ -252,8 +253,8 @@ boot(howto)
#ifdef SHOW_BUSYBUFS
nbusy = 0;
for (bp = &buf[nbuf]; --bp >= buf; ) {
- if ((bp->b_flags & (B_BUSY | B_INVAL))
- == B_BUSY) {
+ if ((bp->b_flags & B_INVAL) == 0 &&
+ BUF_REFCNT(bp) > 0) {
nbusy++;
printf(
"%d: dev:%08lx, flags:%08lx, blkno:%ld, lblkno:%ld\n",
OpenPOWER on IntegriCloud