summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/options.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@gluster.com>2011-09-14 09:50:45 +0530
committerVijay Bellur <vijay@gluster.com>2011-09-29 09:39:50 -0700
commitce8a569e9f18cfff2f2befe259c2022d9b37538f (patch)
treea5afc3ceed7a36509dca452feab1566a1896afd0 /libglusterfs/src/options.c
parentf3a6752cc455676d6e1f946b513636d991825da8 (diff)
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 <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'libglusterfs/src/options.c')
-rw-r--r--libglusterfs/src/options.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/libglusterfs/src/options.c b/libglusterfs/src/options.c
index b64b24e04..1e6413cc0 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;