avoid memcpy of kstat_io_t in kstat_read

This commit is contained in:
Doug MacEachern 2005-12-09 21:10:56 +00:00
parent 225e8e4da4
commit 005fea17c2
1 changed files with 11 additions and 7 deletions

View File

@ -1358,13 +1358,17 @@ static int fs_kstat_read(sigar_t *sigar,
sigar_file_system_usage_t *fsusage,
kstat_t *ksp)
{
kstat_io_t io;
kstat_read(sigar->kc, ksp, &io);
fsusage->disk_reads = io.reads;
fsusage->disk_writes = io.writes;
fsusage->disk_read_bytes = io.nread;
fsusage->disk_write_bytes = io.nwritten;
fsusage->disk_queue = io.wcnt; /* XXX ? */
kstat_io_t *io;
kstat_read(sigar->kc, ksp, NULL);
io = (kstat_io_t *)ksp->ks_data;
fsusage->disk_reads = io->reads;
fsusage->disk_writes = io->writes;
fsusage->disk_read_bytes = io->nread;
fsusage->disk_write_bytes = io->nwritten;
fsusage->disk_queue = io->wcnt; /* XXX ? */
return SIGAR_OK;
}