From 55da339e9a14c5a7e26fc14477595b5d40c4beac Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 4 Jan 2011 10:32:45 +0100 Subject: [PATCH] Node: add and export a 'used disk' function This is similar to iMem. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Balazs Lecz <leczb@google.com> --- Ganeti/HTools/Node.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Ganeti/HTools/Node.hs b/Ganeti/HTools/Node.hs index f355ed547..03849235d 100644 --- a/Ganeti/HTools/Node.hs +++ b/Ganeti/HTools/Node.hs @@ -57,6 +57,7 @@ module Ganeti.HTools.Node , availMem , availCpu , iMem + , iDsk , conflictingPrimaries -- * Formatting , defaultFields @@ -435,6 +436,10 @@ availDisk t = then 0 else _f - _l +-- | Computes the amount of used disk on a given node +iDsk :: Node -> Int +iDsk t = truncate (tDsk t) - fDsk t + -- | Computes the amount of available memory on a given node availMem :: Node -> Int availMem t = -- GitLab