Lock buffer before calling strategy.
Idea-stolen-from: peter (sys/dev/ccd/ccd.c revision 1.49)
This commit is contained in:
parent
839832f8d0
commit
3252fdcd97
@ -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 <dev/vinum/vinumhdr.h>
|
||||
@ -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?
|
||||
|
@ -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 <dev/vinum/vinumhdr.h>
|
||||
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user