Messages in this thread Patch in this message | | | Date | Wed, 22 Jun 2005 23:16:14 -0700 | From | Gerrit Huizenga <> | Subject | [patch 22/38] CKRM e18: Fix share calculation |
| |
Increase the share by the new value if previous value was don't care or unchanged. Otherwise use the difference in values as the increase in share.
Signed-Off-By: Matt Helsley <matthltc@us.ibm.com> Signed-Off-By: Gerrit Huizenga <gh@us.ibm.com>
Index: linux-2.6.12-ckrm1/kernel/ckrm/ckrmutils.c =================================================================== --- linux-2.6.12-ckrm1.orig/kernel/ckrm/ckrmutils.c 2005-06-20 15:04:30.000000000 -0700 +++ linux-2.6.12-ckrm1/kernel/ckrm/ckrmutils.c 2005-06-20 15:04:46.000000000 -0700 @@ -100,7 +100,12 @@ set_shares(struct ckrm_shares *new, stru { int rc = -EINVAL; int cur_usage_guar = cur->total_guarantee - cur->unused_guarantee; - int increase_by = new->my_guarantee - cur->my_guarantee; + int increase_by; + + if (cur->my_guarantee < 0) /* DONTCARE or UNCHANGED */ + increase_by = new->my_guarantee; + else + increase_by = new->my_guarantee - cur->my_guarantee; /* Check total_guarantee for correctness */ if (new->total_guarantee <= CKRM_SHARE_DONTCARE) { -- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |