From ce8a569e9f18cfff2f2befe259c2022d9b37538f Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Wed, 14 Sep 2011 09:50:45 +0530 Subject: performance/io-cache,quick-read: increase cache-size limit Does the following: 1. Increases cache-size limit from 6GB to 32GB. 2. Prevents 'volume set'from failing when cache-size is set over the limit. Just issues a warning. 3. Performs check on cache-size by comparing with total system memory available in init () and reconfigure () methods. Change-Id: I7dd4d8c53051b89a293696abf1ee8dc237e39a20 BUG: 3495 Reviewed-on: http://review.gluster.com/409 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- libglusterfs/src/options.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'libglusterfs/src/options.c') diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c index b64b24e0489..1e6413cc0a9 100644 --- a/libglusterfs/src/options.c +++ b/libglusterfs/src/options.c @@ -131,12 +131,22 @@ xlator_option_validate_sizet (xlator_t *xl, const char *key, const char *value, } if ((size < opt->min) || (size > opt->max)) { - snprintf (errstr, 256, - "'%"PRId64"' in 'option %s %s' is out of range " - "[%"PRId64" - %"PRId64"]", - size, key, value, opt->min, opt->max); - gf_log (xl->name, GF_LOG_ERROR, "%s", errstr); - goto out; + if (strncmp (key, "cache-size", 10) == 0) { + snprintf (errstr, 256, "Cache size %"PRId64" is out of " + "range [%"PRId64" - %"PRId64"]", + size, opt->min, opt->max); + //*op_errstr = gf_strdup (errstr); + gf_log (xl->name, GF_LOG_WARNING, "%s", errstr); + ret = 0; + goto out; + } else { + snprintf (errstr, 256, + "'%"PRId64"' in 'option %s %s' " + "is out of range [%"PRId64" - %"PRId64"]", + size, key, value, opt->min, opt->max); + gf_log (xl->name, GF_LOG_ERROR, "%s", errstr); + goto out; + } } ret = 0; -- cgit