Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/dev/scsipi Pull up revision 1.238 (requested by yamt ...



details:   https://anonhg.NetBSD.org/src/rev/cba7b270a34d
branches:  netbsd-3
changeset: 575134:cba7b270a34d
user:      tron <tron%NetBSD.org@localhost>
date:      Wed Apr 06 11:56:38 2005 +0000

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

diffstat:

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

diffs (40 lines):

diff -r c1d4579bf5a6 -r cba7b270a34d sys/dev/scsipi/sd.c
--- a/sys/dev/scsipi/sd.c       Wed Apr 06 11:56:31 2005 +0000
+++ b/sys/dev/scsipi/sd.c       Wed Apr 06 11:56:38 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sd.c,v 1.237 2005/02/27 00:27:48 perry Exp $   */
+/*     $NetBSD: sd.c,v 1.237.2.1 2005/04/06 11:56:38 tron Exp $        */
 
 /*-
  * Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.237 2005/02/27 00:27:48 perry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.237.2.1 2005/04/06 11:56:38 tron Exp $");
 
 #include "opt_scsi.h"
 #include "rnd.h"
@@ -347,7 +347,6 @@
 sddetach(struct device *self, int flags)
 {
        struct sd_softc *sd = (struct sd_softc *) self;
-       struct buf *bp;
        int s, bmaj, cmaj, i, mn;
 
        /* locate the major number */
@@ -370,12 +369,7 @@
        s = splbio();
 
        /* Kill off any queued buffers. */
-       while ((bp = BUFQ_GET(&sd->buf_queue)) != NULL) {
-               bp->b_error = EIO;
-               bp->b_flags |= B_ERROR;
-               bp->b_resid = bp->b_bcount;
-               biodone(bp);
-       }
+       bufq_drain(&sd->buf_queue);
 
        bufq_free(&sd->buf_queue);
 



Home | Main Index | Thread Index | Old Index