This function returns the amount of available disk, which depends on
whether a low disk limit has been configured or not and on the free disk
space of the node.
, removeSec
, addPri
, addSec
+ -- * Stats
+ , availDisk
-- * Formatting
, list
-- * Misc stuff
r_mem = new_rmem, p_dsk = new_dp,
p_rem = new_prem}
+-- * Stats functions
+
+-- | Computes the amount of available disk on a given node
+availDisk :: Node -> Int
+availDisk t =
+ let _f = f_dsk t
+ _l = lo_dsk t
+ in
+ if _l == noLimitInt
+ then _f
+ else if _f < _l
+ then 0
+ else _f - _l
+
-- * Display functions
-- | String converter for the node list functionality.