projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tracing: Try again for saved cmdline if failed due to locking
[platform/adaptation/renesas_rcar/renesas_kernel.git]
/
kernel
/
res_counter.c
diff --git
a/kernel/res_counter.c
b/kernel/res_counter.c
index
ff55247
..
4aa8a30
100644
(file)
--- a/
kernel/res_counter.c
+++ b/
kernel/res_counter.c
@@
-17,8
+17,8
@@
void res_counter_init(struct res_counter *counter, struct res_counter *parent)
{
spin_lock_init(&counter->lock);
void res_counter_init(struct res_counter *counter, struct res_counter *parent)
{
spin_lock_init(&counter->lock);
- counter->limit = RES
OURCE
_MAX;
- counter->soft_limit = RES
OURCE
_MAX;
+ counter->limit = RES
_COUNTER
_MAX;
+ counter->soft_limit = RES
_COUNTER
_MAX;
counter->parent = parent;
}
counter->parent = parent;
}
@@
-178,23
+178,30
@@
u64 res_counter_read_u64(struct res_counter *counter, int member)
#endif
int res_counter_memparse_write_strategy(const char *buf,
#endif
int res_counter_memparse_write_strategy(const char *buf,
- unsigned long long *res)
+ unsigned long long *res
p
)
{
char *end;
{
char *end;
+ unsigned long long res;
- /* return RES
OURCE
_MAX(unlimited) if "-1" is specified */
+ /* return RES
_COUNTER
_MAX(unlimited) if "-1" is specified */
if (*buf == '-') {
if (*buf == '-') {
-
*
res = simple_strtoull(buf + 1, &end, 10);
- if (
*
res != 1 || *end != '\0')
+ res = simple_strtoull(buf + 1, &end, 10);
+ if (res != 1 || *end != '\0')
return -EINVAL;
return -EINVAL;
- *res
= RESOURCE
_MAX;
+ *res
p = RES_COUNTER
_MAX;
return 0;
}
return 0;
}
-
*
res = memparse(buf, &end);
+ res = memparse(buf, &end);
if (*end != '\0')
return -EINVAL;
if (*end != '\0')
return -EINVAL;
- *res = PAGE_ALIGN(*res);
+ if (PAGE_ALIGN(res) >= res)
+ res = PAGE_ALIGN(res);
+ else
+ res = RES_COUNTER_MAX;
+
+ *resp = res;
+
return 0;
}
return 0;
}