Module Name: src
Committed By: snj
Date: Sat Apr 4 17:49:21 UTC 2009
Modified Files:
src/sys/kern [netbsd-5]: subr_disk.c subr_iostat.c
src/sys/sys [netbsd-5]: disk.h iostat.h
Log Message:
Pull up following revision(s) (requested by ad in ticket #657):
sys/kern/subr_disk.c: revision 1.95
sys/kern/subr_iostat.c: revision 1.17
sys/sys/disk.h: revision 1.52
sys/sys/iostat.h: revision 1.10
Add disk_isbusy(), iostat_isbusy().
To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.93.10.1 src/sys/kern/subr_disk.c
cvs rdiff -u -r1.15 -r1.15.8.1 src/sys/kern/subr_iostat.c
cvs rdiff -u -r1.51 -r1.51.10.1 src/sys/sys/disk.h
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/sys/iostat.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/subr_disk.c
diff -u src/sys/kern/subr_disk.c:1.93 src/sys/kern/subr_disk.c:1.93.10.1
--- src/sys/kern/subr_disk.c:1.93 Mon Apr 28 20:24:04 2008
+++ src/sys/kern/subr_disk.c Sat Apr 4 17:49:21 2009
@@ -1,7 +1,7 @@
-/* $NetBSD: subr_disk.c,v 1.93 2008/04/28 20:24:04 martin Exp $ */
+/* $NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $ */
/*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93 2008/04/28 20:24:04 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_disk.c,v 1.93.10.1 2009/04/04 17:49:21 snj Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -277,6 +277,16 @@
}
/*
+ * Return true if disk has an I/O operation in flight.
+ */
+bool
+disk_isbusy(struct disk *diskp)
+{
+
+ return iostat_isbusy(diskp->dk_stats);
+}
+
+/*
* Set the physical blocksize of a disk, in bytes.
* Only necessary if blocksize != DEV_BSIZE.
*/
Index: src/sys/kern/subr_iostat.c
diff -u src/sys/kern/subr_iostat.c:1.15 src/sys/kern/subr_iostat.c:1.15.8.1
--- src/sys/kern/subr_iostat.c:1.15 Tue May 20 16:03:31 2008
+++ src/sys/kern/subr_iostat.c Sat Apr 4 17:49:21 2009
@@ -1,8 +1,8 @@
-/* $NetBSD: subr_iostat.c,v 1.15 2008/05/20 16:03:31 ad Exp $ */
+/* $NetBSD: subr_iostat.c,v 1.15.8.1 2009/04/04 17:49:21 snj Exp $ */
/* NetBSD: subr_disk.c,v 1.69 2005/05/29 22:24:15 christos Exp */
/*-
- * Copyright (c) 1996, 1997, 1999, 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 1999, 2000, 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.15 2008/05/20 16:03:31 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_iostat.c,v 1.15.8.1 2009/04/04 17:49:21 snj Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -223,6 +223,16 @@
}
/*
+ * Return non-zero if a device has an I/O request in flight.
+ */
+bool
+iostat_isbusy(struct io_stats *stats)
+{
+
+ return stats->io_busy != 0;
+}
+
+/*
* Increment the seek counter. This does look almost redundant but it
* abstracts the stats gathering.
*/
Index: src/sys/sys/disk.h
diff -u src/sys/sys/disk.h:1.51 src/sys/sys/disk.h:1.51.10.1
--- src/sys/sys/disk.h:1.51 Mon Apr 28 20:24:10 2008
+++ src/sys/sys/disk.h Sat Apr 4 17:49:21 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: disk.h,v 1.51 2008/04/28 20:24:10 martin Exp $ */
+/* $NetBSD: disk.h,v 1.51.10.1 2009/04/04 17:49:21 snj Exp $ */
/*-
* Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
@@ -502,6 +502,7 @@
void disk_destroy(struct disk *);
void disk_busy(struct disk *);
void disk_unbusy(struct disk *, long, int);
+bool disk_isbusy(struct disk *);
void disk_blocksize(struct disk *, int);
struct disk *disk_find(const char *);
int disk_ioctl(struct disk *, u_long, void *, int, struct lwp *);
Index: src/sys/sys/iostat.h
diff -u src/sys/sys/iostat.h:1.9 src/sys/sys/iostat.h:1.9.10.1
--- src/sys/sys/iostat.h:1.9 Mon Apr 28 20:24:10 2008
+++ src/sys/sys/iostat.h Sat Apr 4 17:49:21 2009
@@ -1,7 +1,7 @@
-/* $NetBSD: iostat.h,v 1.9 2008/04/28 20:24:10 martin Exp $ */
+/* $NetBSD: iostat.h,v 1.9.10.1 2009/04/04 17:49:21 snj Exp $ */
/*-
- * Copyright (c) 1996, 1997, 2004 The NetBSD Foundation, Inc.
+ * Copyright (c) 1996, 1997, 2004, 2009 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
@@ -98,6 +98,7 @@
void iostat_init(void);
void iostat_busy(struct io_stats *);
void iostat_unbusy(struct io_stats *, long, int);
+bool iostat_isbusy(struct io_stats *);
struct io_stats *iostat_find(const char *);
struct io_stats *iostat_alloc(int32_t, void *, const char *);
void iostat_free(struct io_stats *);