Source-Changes-HG archive

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

[src/netbsd-3]: src/sys/kern Pull up revision 1.68 (requested by yamt in tick...



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

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

diffstat:

 sys/kern/subr_disk.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r cba7b270a34d -r 626f1fc247ef sys/kern/subr_disk.c
--- a/sys/kern/subr_disk.c      Wed Apr 06 11:56:38 2005 +0000
+++ b/sys/kern/subr_disk.c      Wed Apr 06 11:56:43 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_disk.c,v 1.67 2005/02/08 08:56:21 fvdl Exp $      */
+/*     $NetBSD: subr_disk.c,v 1.67.4.1 2005/04/06 11:56:43 tron Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
@@ -74,7 +74,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.67 2005/02/08 08:56:21 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.67.4.1 2005/04/06 11:56:43 tron Exp $");
 
 #include "opt_compat_netbsd.h"
 
@@ -529,6 +529,22 @@
 }
 
 /*
+ * Drain a device buffer queue.
+ */
+void
+bufq_drain(struct bufq_state *bufq)
+{
+       struct buf *bp;
+
+       while ((bp = BUFQ_GET(bufq)) != NULL) {
+               bp->b_error = EIO;
+               bp->b_flags |= B_ERROR;
+               bp->b_resid = bp->b_bcount;
+               biodone(bp);
+       }
+}
+
+/*
  * Destroy a device buffer queue.
  */
 void



Home | Main Index | Thread Index | Old Index