Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/raidframe Pullup 1.99 [oster]:



details:   https://anonhg.NetBSD.org/src/rev/e5d86344dd1c
branches:  netbsd-1-5
changeset: 489962:e5d86344dd1c
user:      tv <tv%NetBSD.org@localhost>
date:      Fri Oct 20 17:48:32 2000 +0000

description:
Pullup 1.99 [oster]:
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:

 sys/dev/raidframe/rf_netbsdkintf.c |  32 ++++++++++++++++++--------------
 1 files changed, 18 insertions(+), 14 deletions(-)

diffs (74 lines):

diff -r e855ca828ed4 -r e5d86344dd1c sys/dev/raidframe/rf_netbsdkintf.c
--- a/sys/dev/raidframe/rf_netbsdkintf.c        Fri Oct 20 17:48:15 2000 +0000
+++ b/sys/dev/raidframe/rf_netbsdkintf.c        Fri Oct 20 17:48:32 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.6 2000/10/18 02:45:41 tv Exp $       */
+/*     $NetBSD: rf_netbsdkintf.c,v 1.92.2.7 2000/10/20 17:48:32 tv 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,13 +1672,14 @@
                 */
                do_async = 1;
                
+               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 */
                
-               /* XXX we're still at splbio() here... do we *really* 
-                  need to be? */
-
-               
                retcode = rf_DoAccess(raidPtr, (bp->b_flags & B_READ) ?
                                      RF_IO_TYPE_READ : RF_IO_TYPE_WRITE,
                                      do_async, raid_addr, num_blocks,
@@ -1724,9 +1726,6 @@
        }
        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 @@
        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 @@
        *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));
+}



Home | Main Index | Thread Index | Old Index