summaryrefslogtreecommitdiffstats
path: root/sys/sys/devicestat.h
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-03-08 19:55:59 +0000
committerphk <phk@FreeBSD.org>2003-03-08 19:55:59 +0000
commit748049e0df41b841746fcdf2b0cb9402838e69f6 (patch)
tree08a73f146902fee342b56f70e4fe462cfc07d1de /sys/sys/devicestat.h
parent95fa81544f1816dfe2bbd004f9290f8c8d9fd5e2 (diff)
downloadFreeBSD-src-748049e0df41b841746fcdf2b0cb9402838e69f6.zip
FreeBSD-src-748049e0df41b841746fcdf2b0cb9402838e69f6.tar.gz
Augment the devstat structure with 3 new fields and bump the DEVSTAT_VERSION.
Two fields are sequence numbers for integrity check when we switch devstat to use mmap to export data rather than sysctl, the last field is to mark this as an allocated devstat entry.
Diffstat (limited to 'sys/sys/devicestat.h')
-rw-r--r--sys/sys/devicestat.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/sys/devicestat.h b/sys/sys/devicestat.h
index a75aff3..1136044 100644
--- a/sys/sys/devicestat.h
+++ b/sys/sys/devicestat.h
@@ -34,6 +34,9 @@
#include <sys/queue.h>
#include <sys/time.h>
+/*
+ * XXX: Should really be SPECNAMELEN
+ */
#define DEVSTAT_NAME_LEN 16
/*
@@ -45,7 +48,7 @@
* userland utilities to determine whether or not they are in sync with the
* kernel.
*/
-#define DEVSTAT_VERSION 4
+#define DEVSTAT_VERSION 5
/*
* These flags specify which statistics features are supported or not
@@ -121,6 +124,8 @@ typedef enum {
} devstat_type_flags;
struct devstat {
+ int sequence0; /* Update sequence# */
+ int allocated; /* Allocated entry */
STAILQ_ENTRY(devstat) dev_links;
u_int32_t device_number; /*
* Devstat device
@@ -203,6 +208,8 @@ struct devstat {
*/
devstat_type_flags device_type; /* Device type */
devstat_priority priority; /* Controls list pos. */
+
+ int sequence1; /* Update sequence# */
};
STAILQ_HEAD(devstatlist, devstat);
@@ -210,6 +217,12 @@ STAILQ_HEAD(devstatlist, devstat);
#ifdef _KERNEL
struct bio;
+struct devstat *devstat_new_entry(const char *dev_name,
+ int unit_number, u_int32_t block_size,
+ devstat_support_flags flags,
+ devstat_type_flags device_type,
+ devstat_priority priority);
+
void devstat_add_entry(struct devstat *ds, const char *dev_name,
int unit_number, u_int32_t block_size,
devstat_support_flags flags,
OpenPOWER on IntegriCloud