Re: PATCH: allow percentile size of tmpfs (2.5.66 / 2.4.20-pre2)

Hugh Dickins
2003-04-01T10:58:28Z

On 1 Apr 2003, Xavier Bestel wrote:
> size = memparse(value,&rest);
> + if (*rest == '%') {
> + struct sysinfo si;
> + si_meminfo(&si);
> + size = (si.totalram << PAGE_CACHE_SHIFT) / 100 * size;
>
> (si.totalram << PAGE_CACHE_SHIFT) * size / 100;
> would have been better precision-wise.

Hardly, it'll overflow in even more cases
than CaT's (si.totalram << PAGE_CACHE_SHIFT).
I'll take a look at this later, not right now.

Hugh