summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_dev.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-02-08 13:03:57 +0000
committerphk <phk@FreeBSD.org>2003-02-08 13:03:57 +0000
commit04a4ba381f551a8fb24d018a99d63e4b8a4eec00 (patch)
treeee0ea82e7a7c15d53378207492946755ff1ca6b9 /sys/geom/geom_dev.c
parent15f4f6a52b122bc25685c03d547db8506a57b97a (diff)
downloadFreeBSD-src-04a4ba381f551a8fb24d018a99d63e4b8a4eec00.zip
FreeBSD-src-04a4ba381f551a8fb24d018a99d63e4b8a4eec00.tar.gz
Move the g_stat struct to its own .h file, we will export it to other code.
Insted of embedding a struct g_stat in consumers and providers, merely include a pointer. Remove a couple of <sys/time.h> includes now unneeded. Add a special allocator for struct g_stat. This allocator will allocate entire pages and hand out g_stat functions from there. The "id" field indicates free/used status. Add "/dev/geom.stats" device driver whic exports the pages from the allocator to userland with mmap(2) in read-only mode. This mmap(2) interface should be considered a non-public interface and the functions in libgeom (not yet committed) should be used to access the statistics data.
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r--sys/geom/geom_dev.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 5c1cb05..07a1df3 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -50,6 +50,7 @@
#include <sys/fcntl.h>
#include <geom/geom.h>
#include <geom/geom_int.h>
+#include <geom/geom_stats.h>
#include <machine/limits.h>
static d_open_t g_dev_open;
@@ -428,7 +429,7 @@ g_dev_orphan(struct g_consumer *cp)
gp = cp->geom;
g_trace(G_T_TOPOLOGY, "g_dev_orphan(%p(%s))", cp, gp->name);
g_topology_assert();
- if (cp->stat.nop != cp->stat.nend) /* XXX ? */
+ if (cp->stat->nop != cp->stat->nend) /* XXX ? */
return;
dev = gp->softc;
if (dev->si_flags & SI_DUMPDEV)
OpenPOWER on IntegriCloud