aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-03-18 09:53:46 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-03-18 09:53:46 +0000
commit2892a228adfb334ae2ad66187d5376d9c17878c2 (patch)
treef9c829b5c0fcc734b0a2c23bc08099e8c618ead7 /lib
parent7e69ddc97386a99193ab2f23e9c394f9066322e4 (diff)
downloadsrc-2892a228adfb334ae2ad66187d5376d9c17878c2.tar.gz
src-2892a228adfb334ae2ad66187d5376d9c17878c2.zip
Use devstat instead of GEOM private statistics structure.
Notes
Notes: svn path=/head/; revision=112372
Diffstat (limited to 'lib')
-rw-r--r--lib/libgeom/geom_stats.c12
-rw-r--r--lib/libgeom/libgeom.h3
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c
index 9f9faf229635..14f9b222123c 100644
--- a/lib/libgeom/geom_stats.c
+++ b/lib/libgeom/geom_stats.c
@@ -40,8 +40,8 @@
#include <sys/mman.h>
#include <sys/time.h>
#include <sys/types.h>
+#include <sys/devicestat.h>
-#include <geom/geom_stats.h>
/************************************************************/
static uint npages, pagesize, spp;
@@ -85,11 +85,11 @@ geom_stats_open(void)
if (statsfd != -1)
return (EBUSY);
- statsfd = open(_PATH_DEV GEOM_STATS_DEVICE, O_RDONLY);
+ statsfd = open(_PATH_DEV DEVSTAT_DEVICE_NAME, O_RDONLY);
if (statsfd < 0)
return (errno);
pagesize = getpagesize();
- spp = pagesize / sizeof(struct g_stat);
+ spp = pagesize / sizeof(struct devstat);
p = mmap(NULL, pagesize, PROT_READ, 0, statsfd, 0);
if (p == MAP_FAILED) {
error = errno;
@@ -166,14 +166,14 @@ geom_stats_snapshot_reset(void *arg)
sp->u = sp->v = 0;
}
-struct g_stat *
+struct devstat *
geom_stats_snapshot_next(void *arg)
{
- struct g_stat *gsp;
+ struct devstat *gsp;
struct snapshot *sp;
sp = arg;
- gsp = (struct g_stat *)
+ gsp = (struct devstat *)
(sp->ptr + sp->u * pagesize + sp->v * sizeof *gsp);
if (++sp->v >= sp->perpage) {
if (++sp->u >= sp->pages)
diff --git a/lib/libgeom/libgeom.h b/lib/libgeom/libgeom.h
index 524194e887ba..db761351248b 100644
--- a/lib/libgeom/libgeom.h
+++ b/lib/libgeom/libgeom.h
@@ -33,7 +33,6 @@
#include <sys/queue.h>
#include <sys/time.h>
-#include <geom/geom_stats.h>
void geom_stats_close(void);
void geom_stats_resync(void);
@@ -42,7 +41,7 @@ void *geom_stats_snapshot_get(void);
void geom_stats_snapshot_free(void *arg);
void geom_stats_snapshot_timestamp(void *arg, struct timespec *tp);
void geom_stats_snapshot_reset(void *arg);
-struct g_stat *geom_stats_snapshot_next(void *arg);
+struct devstat *geom_stats_snapshot_next(void *arg);
char *geom_getxml(void);