- new_failn1 = computeFailN1 new_rmem old_mem new_dsk in
- if (failHealth old_mem new_dsk) || (new_failn1 && not (failN1 t)) then
- Nothing
- else
- let new_slist = iname:(slist t)
- new_dp = (fromIntegral new_dsk) / (t_dsk t)
- in
- Just t {slist = new_slist, f_dsk = new_dsk,
- peers = new_peers, failN1 = new_failn1,
- r_mem = new_rmem, p_dsk = new_dp,
- p_rem = new_prem}
+ new_failn1 = computeFailN1 new_rmem old_mem new_dsk
+ new_dp = (fromIntegral new_dsk) / (t_dsk t)
+ in if (failHealth old_mem new_dsk) || (new_failn1 && not (failN1 t)) ||
+ (failLimits t new_dp noLimit)
+ then
+ Nothing
+ else
+ let new_slist = iname:(slist t)
+ in
+ Just t {slist = new_slist, f_dsk = new_dsk,
+ peers = new_peers, failN1 = new_failn1,
+ r_mem = new_rmem, p_dsk = new_dp,
+ p_rem = new_prem}