From 67812eacd74d5841e890b703d4ec2d5a76288830 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Sat, 26 Jun 1999 02:47:16 +0000 Subject: 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. --- sys/dev/fdc/fdc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'sys/dev/fdc') diff --git a/sys/dev/fdc/fdc.c b/sys/dev/fdc/fdc.c index 77ebb365aa4b..36e55244eb0b 100644 --- a/sys/dev/fdc/fdc.c +++ b/sys/dev/fdc/fdc.c @@ -47,7 +47,7 @@ * SUCH DAMAGE. * * from: @(#)fd.c 7.4 (Berkeley) 5/25/91 - * $Id: fd.c,v 1.145 1999/05/30 16:52:12 phk Exp $ + * $Id: fd.c,v 1.146 1999/05/31 18:39:16 dfr Exp $ * */ @@ -2196,7 +2196,9 @@ fdformat(dev, finfo, p) */ PHOLD(p); bzero((void *)bp, sizeof(struct buf)); - bp->b_flags = B_BUSY | B_PHYS | B_FORMAT; + BUF_LOCKINIT(bp); + BUF_LOCK(bp, LK_EXCLUSIVE); + bp->b_flags = B_PHYS | B_FORMAT; /* * calculate a fake blkno, so fdstrategy() would initiate a @@ -2232,6 +2234,8 @@ fdformat(dev, finfo, p) * allow the process to be swapped */ PRELE(p); + BUF_UNLOCK(bp); + BUF_LOCKFREE(bp); free(bp, M_TEMP); return rv; } -- cgit v1.3