lkml.org 
[lkml]   [2005]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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/

\
 
 \ /
  Last update: 2005-06-23 08:51    [W:0.199 / U:2.928 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site