diff options
author | peter <peter@FreeBSD.org> | 1999-06-27 09:28:43 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-06-27 09:28:43 +0000 |
commit | 320f4b564f393ae55af2124a46158318a41aecce (patch) | |
tree | 218233238a20c0eff91d6da311c8dc50cc9fa685 /sys/geom | |
parent | 442c2839a54f29749b20580d8d31fd0b1bfcee89 (diff) | |
download | FreeBSD-src-320f4b564f393ae55af2124a46158318a41aecce.zip FreeBSD-src-320f4b564f393ae55af2124a46158318a41aecce.tar.gz |
Initialize and hold locks for ccd generated bufs..
Obtained from: Matt Dillon <dillon@backplane.com>
Diffstat (limited to 'sys/geom')
-rw-r--r-- | sys/geom/geom_ccd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/geom/geom_ccd.c b/sys/geom/geom_ccd.c index 2f26794..bf79717 100644 --- a/sys/geom/geom_ccd.c +++ b/sys/geom/geom_ccd.c @@ -1,4 +1,4 @@ -/* $Id: ccd.c,v 1.47 1999/05/11 19:54:00 phk Exp $ */ +/* $Id: ccd.c,v 1.48 1999/05/30 16:51:18 phk Exp $ */ /* $NetBSD: ccd.c,v 1.22 1995/12/08 19:13:26 thorpej Exp $ */ @@ -915,13 +915,14 @@ ccdbuffer(cb, cs, bp, bn, addr, bcount) cbp->cb_buf.b_data = addr; cbp->cb_buf.b_vp = ci->ci_vp; LIST_INIT(&cbp->cb_buf.b_dep); + BUF_LOCKINIT(&cbp->cb_buf); + BUF_LOCK(&cbp->cb_buf, LK_EXCLUSIVE); cbp->cb_buf.b_resid = 0; if (cs->sc_ileave == 0) cbc = dbtob((off_t)(ci->ci_size - cbn)); else cbc = dbtob((off_t)(cs->sc_ileave - cboff)); - cbp->cb_buf.b_bcount = (cbc < bcount) ? cbc : bcount; - + cbp->cb_buf.b_bcount = (cbc < bcount) ? cbc : bcount; cbp->cb_buf.b_bufsize = cbp->cb_buf.b_bcount; /* @@ -947,6 +948,8 @@ ccdbuffer(cb, cs, bp, bn, addr, bcount) cbp->cb_buf.b_dev = ci2->ci_dev; cbp->cb_buf.b_vp = ci2->ci_vp; LIST_INIT(&cbp->cb_buf.b_dep); + BUF_LOCKINIT(&cbp->cb_buf); + BUF_LOCK(&cbp->cb_buf, LK_EXCLUSIVE); cbp->cb_comp = ci2 - cs->sc_cinfo; cb[1] = cbp; /* link together the ccdbuf's and clear "mirror done" flag */ |