fix(fs): Calculate free bytes properly
Seems this was missed in a682d2af91
This is now also consistent with what df does
Closes #743
This commit is contained in:
parent
67f1ceaaca
commit
a0b888b5e6
@ -17,10 +17,10 @@ namespace modules {
|
|||||||
string type;
|
string type;
|
||||||
string fsname;
|
string fsname;
|
||||||
|
|
||||||
unsigned long long bytes_free{0ULL};
|
uint64_t bytes_free{0ULL};
|
||||||
unsigned long long bytes_used{0ULL};
|
uint64_t bytes_used{0ULL};
|
||||||
unsigned long long bytes_avail{0ULL};
|
uint64_t bytes_avail{0ULL};
|
||||||
unsigned long long bytes_total{0ULL};
|
uint64_t bytes_total{0ULL};
|
||||||
|
|
||||||
int percentage_free{0};
|
int percentage_free{0};
|
||||||
int percentage_used{0};
|
int percentage_used{0};
|
||||||
|
@ -98,7 +98,7 @@ namespace modules {
|
|||||||
|
|
||||||
// see: http://en.cppreference.com/w/cpp/filesystem/space
|
// see: http://en.cppreference.com/w/cpp/filesystem/space
|
||||||
mount->bytes_total = buffer.f_frsize * buffer.f_blocks;
|
mount->bytes_total = buffer.f_frsize * buffer.f_blocks;
|
||||||
mount->bytes_free = buffer.f_bsize * buffer.f_bfree;
|
mount->bytes_free = buffer.f_frsize * buffer.f_bfree;
|
||||||
mount->bytes_used = mount->bytes_total - mount->bytes_free;
|
mount->bytes_used = mount->bytes_total - mount->bytes_free;
|
||||||
mount->bytes_avail = buffer.f_frsize * buffer.f_bavail;
|
mount->bytes_avail = buffer.f_frsize * buffer.f_bavail;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user