summaryrefslogtreecommitdiff
path: root/sys/dev/raidframe
diff options
context:
space:
mode:
authoroster <oster@NetBSD.org>2000-10-20 02:24:45 +0000
committeroster <oster@NetBSD.org>2000-10-20 02:24:45 +0000
commitd349cdf1ef3be78da19982c30077c75bf91db269 (patch)
tree8c048b1ca103891a26763babb399b1b48f2ca065 /sys/dev/raidframe
parentb2eacf307e79d95c218e3381a44b583c5d647f44 (diff)
Move disk_busy() and disk_unbusy() to more sane locations. Values
reported by 'systat iostat' and friends are now much more correct for RAIDframe devices. Thanks to Andrew Doran for poking me about this, and for suggestions on and review of the changes.
Diffstat (limited to 'sys/dev/raidframe')
-rw-r--r--sys/dev/raidframe/rf_kintf.h3
-rw-r--r--sys/dev/raidframe/rf_netbsdkintf.c30
-rw-r--r--sys/dev/raidframe/rf_states.c10
3 files changed, 27 insertions, 16 deletions
diff --git a/sys/dev/raidframe/rf_kintf.h b/sys/dev/raidframe/rf_kintf.h
index f8ba93e56cd..b96d0719fc8 100644
--- a/sys/dev/raidframe/rf_kintf.h
+++ b/sys/dev/raidframe/rf_kintf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_kintf.h,v 1.14 2000/06/04 02:05:13 oster Exp $ */
+/* $NetBSD: rf_kintf.h,v 1.15 2000/10/20 02:24:45 oster Exp $ */
/*
* rf_kintf.h
*
@@ -54,4 +54,5 @@ void raid_init_component_label(RF_Raid_t *, RF_ComponentLabel_t *);
void rf_print_component_label(RF_ComponentLabel_t *);
void rf_UnconfigureVnodes( RF_Raid_t * );
void rf_close_component( RF_Raid_t *, struct vnode *, int);
+void rf_disk_unbusy(RF_RaidAccessDesc_t *);
#endif /* _RF__RF_KINTF_H_ */
diff --git a/sys/dev/raidframe/rf_netbsdkintf.c b/sys/dev/raidframe/rf_netbsdkintf.c
index 6d328b247dc..556d076728d 100644
--- a/sys/dev/raidframe/rf_netbsdkintf.c
+++ b/sys/dev/raidframe/rf_netbsdkintf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_netbsdkintf.c,v 1.98 2000/10/17 03:39:41 oster Exp $ */
+/* $NetBSD: rf_netbsdkintf.c,v 1.99 2000/10/20 02:24:45 oster Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -142,6 +142,7 @@
#include "rf_copyback.h"
#include "rf_dag.h"
#include "rf_dagflags.h"
+#include "rf_desc.h"
#include "rf_diskqueue.h"
#include "rf_acctrace.h"
#include "rf_etimer.h"
@@ -1671,12 +1672,13 @@ raidstart(raidPtr)
*/
do_async = 1;
- /* don't ever condition on bp->b_flags & B_WRITE.
- * always condition on B_READ instead */
-
+ disk_busy(&rs->sc_dkdev);
+
/* XXX we're still at splbio() here... do we *really*
need to be? */
+ /* don't ever condition on bp->b_flags & B_WRITE.
+ * always condition on B_READ instead */
retcode = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ?
RF_IO_TYPE_READ : RF_IO_TYPE_WRITE,
@@ -1724,9 +1726,6 @@ rf_DispatchKernelIO(queue, req)
}
rs = &raid_softc[unit];
- /* XXX is this the right place? */
- disk_busy(&rs->sc_dkdev);
-
bp = req->bp;
#if 1
/* XXX when there is a physical disk failure, someone is passing us a
@@ -1881,12 +1880,6 @@ KernelWakeupFunc(vbp)
rs = &raid_softc[unit];
RAIDPUTBUF(rs, raidbp);
-
- if (bp->b_resid == 0) {
- /* XXX is this the right place for a disk_unbusy()??!??!?!? */
- disk_unbusy(&rs->sc_dkdev, (bp->b_bcount - bp->b_resid));
- }
-
rf_DiskIOComplete(queue, req, (bp->b_flags & B_ERROR) ? 1 : 0);
(req->CompleteFunc) (req->argument, (bp->b_flags & B_ERROR) ? 1 : 0);
@@ -3292,3 +3285,14 @@ rf_auto_config_set(cset,unit)
*unit = raidID;
return(retcode);
}
+
+void
+rf_disk_unbusy(desc)
+ RF_RaidAccessDesc_t *desc;
+{
+ struct buf *bp;
+
+ bp = (struct buf *)desc->bp;
+ disk_unbusy(&raid_softc[desc->raidPtr->raidid].sc_dkdev,
+ (bp->b_bcount - bp->b_resid));
+}
diff --git a/sys/dev/raidframe/rf_states.c b/sys/dev/raidframe/rf_states.c
index a449a603089..d612b9a5b47 100644
--- a/sys/dev/raidframe/rf_states.c
+++ b/sys/dev/raidframe/rf_states.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rf_states.c,v 1.14 2000/10/12 03:28:49 oster Exp $ */
+/* $NetBSD: rf_states.c,v 1.15 2000/10/20 02:24:45 oster Exp $ */
/*
* Copyright (c) 1995 Carnegie-Mellon University.
* All rights reserved.
@@ -201,7 +201,13 @@ rf_State_LastState(RF_RaidAccessDesc_t * desc)
*/
if (desc->async_flag == 0)
wakeup(desc->bp);
-
+
+ /*
+ * That's all the IO for this one... unbusy the 'disk'.
+ */
+
+ rf_disk_unbusy(desc);
+
/*
* Wakeup any requests waiting to go.
*/