Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/ata Pull up revision 1.299 (requested by yamt in ...



details:   https://anonhg.NetBSD.org/src/rev/e69cba7da4c5
branches:  netbsd-3
changeset: 575141:e69cba7da4c5
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Apr 06 11:57:20 2005 +0000

description:
Pull up revision 1.299 (requested by yamt in ticket #112):
introduce a function to drain bufq and use it where appropriate.

diffstat:

 sys/dev/ata/wd.c |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (40 lines):

diff -r 0019bd30a4f7 -r e69cba7da4c5 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Wed Apr 06 11:57:14 2005 +0000
+++ b/sys/dev/ata/wd.c  Wed Apr 06 11:57:20 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wd.c,v 1.298 2005/02/27 00:26:59 perry Exp $ */
+/*     $NetBSD: wd.c,v 1.298.2.1 2005/04/06 11:57:20 tron Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.298 2005/02/27 00:26:59 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.298.2.1 2005/04/06 11:57:20 tron Exp $");
 
 #ifndef ATADEBUG
 #define ATADEBUG
@@ -425,7 +425,6 @@
 wddetach(struct device *self, int flags)
 {
        struct wd_softc *sc = (struct wd_softc *)self;
-       struct buf *bp;
        int s, bmaj, cmaj, i, mn;
 
        /* locate the major number */
@@ -445,12 +444,7 @@
        s = splbio();
 
        /* Kill off any queued buffers. */
-       while ((bp = BUFQ_GET(&sc->sc_q)) != NULL) {
-               bp->b_error = EIO;
-               bp->b_flags |= B_ERROR;
-               bp->b_resid = bp->b_bcount;
-               biodone(bp);
-       }
+       bufq_drain(&sc->sc_q);
 
        bufq_free(&sc->sc_q);
        sc->atabus->ata_killpending(sc->drvp);



Home | Main Index | Thread Index | Old Index