Messages in this thread | | | Date | Fri, 5 Jun 2009 13:20:31 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH mmotm] memcg: add interface to reset limits |
| |
On Fri, 5 Jun 2009 22:22:45 +0900 Daisuke Nishimura <d-nishimura@mtf.biglobe.ne.jp> wrote:
> We don't have interface to reset mem.limit or memsw.limit now. > > This patch allows to reset mem.limit or memsw.limit when they are > being set to -1. > > ... > > @@ -133,6 +133,16 @@ int res_counter_memparse_write_strategy(const char *buf, > unsigned long long *res) > { > char *end; > + > + /* return RESOURCE_MAX(unlimited) if "-1" is specified */ > + if (*buf == '-') { > + *res = simple_strtoull(buf + 1, &end, 10); > + if (*res != 1 || *end != '\0') > + return -EINVAL; > + *res = RESOURCE_MAX; > + return 0; > + }
The test for (*end != '\0') would be unneeded if strict_strtoull() had been used.
> + > /* FIXME - make memparse() take const char* args */ > *res = memparse((char *)buf, &end); > if (*end != '\0')
| |