lkml.org 
[lkml]   [2010]   [Feb]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] Make VM_MAX_READAHEAD a kernel parameter
From
> +static int __init readahead(char *str)
> +{
> +       if (!str)
> +               return -EINVAL;
> +       vm_max_readahead_kb = memparse(str, &str) / 1024ULL;

Just wondering, shouldn't you check whether the str had a valid value
[memparse (str, &next); next > str ..] and if it didn't, then use the
DEFAULT_VM_MAX_READAHEAD ? Otherwise, incase of a invalid
value, the readahead value will become zero.

> +       default_backing_dev_info.ra_pages = vm_max_readahead_kb
> +                                               * 1024 / PAGE_CACHE_SIZE;
> +       return 0;
> +}
> +
> +early_param("readahead", readahead);
> +

-Ankit
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-02-11 12:17    [W:0.080 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site