SIGAR_DISK_STATS_NOTIMPL -> SIGAR_DISK_STATS_INIT
This commit is contained in:
parent
2e6a1c1a20
commit
77a9528f91
|
@ -310,9 +310,6 @@ int sigar_group_name_get(sigar_t *sigar, int gid, char *buf, int buflen);
|
||||||
(disk)->service_time = SIGAR_FIELD_NOTIMPL; \
|
(disk)->service_time = SIGAR_FIELD_NOTIMPL; \
|
||||||
(disk)->snaptime = 0
|
(disk)->snaptime = 0
|
||||||
|
|
||||||
#define SIGAR_DISK_STATS_NOTIMPL(fsusage) \
|
|
||||||
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
|
||||||
|
|
||||||
/* key used for filesystem (/) -> device (/dev/hda1) mapping */
|
/* key used for filesystem (/) -> device (/dev/hda1) mapping */
|
||||||
/* and disk_usage cache for service_time */
|
/* and disk_usage cache for service_time */
|
||||||
#define SIGAR_FSDEV_ID(sb) \
|
#define SIGAR_FSDEV_ID(sb) \
|
||||||
|
|
|
@ -1679,7 +1679,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->disk_write_bytes = SIGAR_FIELD_NOTIMPL;
|
fsusage->disk_write_bytes = SIGAR_FIELD_NOTIMPL;
|
||||||
fsusage->disk_queue = SIGAR_FIELD_NOTIMPL;
|
fsusage->disk_queue = SIGAR_FIELD_NOTIMPL;
|
||||||
#else
|
#else
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
|
|
|
@ -612,7 +612,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
||||||
|
|
||||||
if (!sigar->fsdev) {
|
if (!sigar->fsdev) {
|
||||||
if (create_fsdev_cache(sigar) != SIGAR_OK) {
|
if (create_fsdev_cache(sigar) != SIGAR_OK) {
|
||||||
|
|
|
@ -341,7 +341,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -479,7 +479,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->free_files = buf.f_ffree;
|
fsusage->free_files = buf.f_ffree;
|
||||||
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
fsusage->use_percent = sigar_file_system_usage_calc_used(sigar, fsusage);
|
||||||
|
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,7 +204,7 @@ int sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
fsusage->used = -1;
|
fsusage->used = -1;
|
||||||
fsusage->files = -1;
|
fsusage->files = -1;
|
||||||
fsusage->free_files = -1;
|
fsusage->free_files = -1;
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
SIGAR_DISK_STATS_INIT(&fsusage->disk)
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1791,6 +1791,8 @@ SIGAR_DECLARE(int) sigar_disk_usage_get(sigar_t *sigar,
|
||||||
PERF_COUNTER_DEFINITION *counter;
|
PERF_COUNTER_DEFINITION *counter;
|
||||||
DWORD perf_offsets[PERF_IX_DISK_MAX];
|
DWORD perf_offsets[PERF_IX_DISK_MAX];
|
||||||
|
|
||||||
|
SIGAR_DISK_STATS_INIT(disk);
|
||||||
|
|
||||||
if (!object) {
|
if (!object) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
@ -1874,10 +1876,6 @@ sigar_file_system_usage_get(sigar_t *sigar,
|
||||||
|
|
||||||
status = sigar_disk_usage_get(sigar, dirname, &fsusage->disk);
|
status = sigar_disk_usage_get(sigar, dirname, &fsusage->disk);
|
||||||
|
|
||||||
if (status != SIGAR_OK) {
|
|
||||||
SIGAR_DISK_STATS_NOTIMPL(fsusage);
|
|
||||||
}
|
|
||||||
|
|
||||||
return SIGAR_OK;
|
return SIGAR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue