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 <[EMAIL PROTECTED]>
Signed-Off-By: Gerrit Huizenga <[EMAIL PROTECTED]>

Index: linux-2.6.13-ckrm1/kernel/ckrm/ckrmutils.c
===================================================================
--- linux-2.6.13-ckrm1.orig/kernel/ckrm/ckrmutils.c     2005-09-09 
17:27:22.000000000 -0700
+++ linux-2.6.13-ckrm1/kernel/ckrm/ckrmutils.c  2005-09-09 17:42:33.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) {

--


-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to