From 3252fdcd97c3af96c6e7035513cc2176c8a6bed9 Mon Sep 17 00:00:00 2001 From: Greg Lehey Date: Tue, 29 Jun 1999 04:10:05 +0000 Subject: [PATCH] Lock buffer before calling strategy. Idea-stolen-from: peter (sys/dev/ccd/ccd.c revision 1.49) --- sys/dev/vinum/vinumrequest.c | 7 +++++-- sys/dev/vinum/vinumrevive.c | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/dev/vinum/vinumrequest.c b/sys/dev/vinum/vinumrequest.c index c81a4ca090ad..ffbc76bd4a80 100644 --- a/sys/dev/vinum/vinumrequest.c +++ b/sys/dev/vinum/vinumrequest.c @@ -33,7 +33,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumrequest.c,v 1.26 1999/06/24 08:56:03 grog Exp $ + * $Id: vinumrequest.c,v 1.23 1999/03/20 21:58:38 grog Exp grog $ */ #include @@ -725,7 +725,10 @@ build_rq_buffer(struct rqelement *rqe, struct plex *plex) /* Initialize the buf struct */ bp->b_flags = ubp->b_flags & (B_NOCACHE | B_READ | B_ASYNC); /* copy these flags from user bp */ - bp->b_flags |= B_CALL; /* inform us when it's done */ + bp->b_flags |= B_CALL; /* inform us when it's done */ + BUF_LOCKINIT(bp); /* get a lock for the buffer */ + BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ + /* * XXX Should we check for reviving plexes here, and * set B_ORDERED if so? diff --git a/sys/dev/vinum/vinumrevive.c b/sys/dev/vinum/vinumrevive.c index 25c0ff8b6bf9..9eec5f5170a9 100644 --- a/sys/dev/vinum/vinumrevive.c +++ b/sys/dev/vinum/vinumrevive.c @@ -33,7 +33,7 @@ * otherwise) arising in any way out of the use of this software, even if * advised of the possibility of such damage. * - * $Id: vinumrevive.c,v 1.12 1999/05/15 05:49:21 grog Exp $ + * $Id: vinumrevive.c,v 1.7 1999/02/28 02:12:18 grog Exp grog $ */ #include @@ -146,6 +146,8 @@ revive_block(int sdno) bp->b_dev = VINUMRBDEV(sdno, VINUM_RAWSD_TYPE); /* create the device number */ bp->b_flags = B_ORDERED; /* and make this an ordered write */ + BUF_LOCKINIT(bp); /* get a lock for the buffer */ + BUF_LOCK(bp, LK_EXCLUSIVE); /* and lock it */ bp->b_resid = 0x0; bp->b_blkno = sd->revived; /* write it to here */ sdio(bp); /* perform the I/O */