Commit e2c478a9 authored by Misbah Mubarak's avatar Misbah Mubarak

Fixing a couple of query functions for resource LP

parent 5ec80178
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "codes/resource.h" #include "codes/resource.h"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdio.h>
static uint64_t min_u64(uint64_t a, uint64_t b){ static uint64_t min_u64(uint64_t a, uint64_t b){
return a < b ? a : b; return a < b ? a : b;
...@@ -63,7 +64,8 @@ int resource_get_avail(resource_token_t tok, uint64_t *avail, resource *r){ ...@@ -63,7 +64,8 @@ int resource_get_avail(resource_token_t tok, uint64_t *avail, resource *r){
return 2; return 2;
} }
else{ else{
return r->avail[tok]; *avail = r->avail[tok];
return 0;
} }
} }
...@@ -75,7 +77,8 @@ int resource_get_used(resource_token_t tok, uint64_t *used, resource *r){ ...@@ -75,7 +77,8 @@ int resource_get_used(resource_token_t tok, uint64_t *used, resource *r){
return 2; return 2;
} }
else{ else{
return r->max[tok] - r->avail[tok]; *used = r->max[tok] - r->avail[tok];
return 0;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment