Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
e2c478a9
Commit
e2c478a9
authored
Aug 06, 2015
by
Misbah Mubarak
Browse files
Fixing a couple of query functions for resource LP
parent
5ec80178
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/util/resource.c
View file @
e2c478a9
...
...
@@ -7,6 +7,7 @@
#include "codes/resource.h"
#include <assert.h>
#include <string.h>
#include <stdio.h>
static
uint64_t
min_u64
(
uint64_t
a
,
uint64_t
b
){
return
a
<
b
?
a
:
b
;
...
...
@@ -63,7 +64,8 @@ int resource_get_avail(resource_token_t tok, uint64_t *avail, resource *r){
return
2
;
}
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){
return
2
;
}
else
{
return
r
->
max
[
tok
]
-
r
->
avail
[
tok
];
*
used
=
r
->
max
[
tok
]
-
r
->
avail
[
tok
];
return
0
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment