From bc3465f872bfbcb861b5c31402e44575ff0280cf Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Fri, 8 Nov 2024 15:10:38 +0100 Subject: [PATCH] free_pages and fix free_bytes --- checkQstar.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/checkQstar.go b/checkQstar.go index 4458ac9..9fcfee7 100644 --- a/checkQstar.go +++ b/checkQstar.go @@ -511,7 +511,11 @@ func readFilesystem(filesystem string) (*params, error) { // calculate free bytes if max_number_of_pages >= 0 && present_pages >= 0 { - item["free_bytes"] = (max_number_of_pages - present_pages) * pageSize + free_pages := max_number_of_pages - present_pages + if free_pages >= 0 { + item["free_pages"] = free_pages + item["free_bytes"] = free_pages * pageSize + } } return ¶ms{