summaryrefslogtreecommitdiffstats
path: root/xlators/performance/quick-read/src
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-08-16 13:10:41 +0530
committerAnand Avati <avati@gluster.com>2011-08-18 22:42:48 -0700
commitce0aaba383b97dca52d11c18846a8154d529bf8a (patch)
tree494673947140ddded481e4532ce6c340eac09446 /xlators/performance/quick-read/src
parentb7596882b3ceba77bd812d2e5757d9fa3aa0fa17 (diff)
mgmt/Glusterd: Implementation volume set help/help-xml
Change-Id: I0c54fd1c15550e5e5551e95ed32adb14d8029fab Reviewed-on: http://review.gluster.com/238 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/performance/quick-read/src')
-rw-r--r--xlators/performance/quick-read/src/quick-read.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index d04ea4fc60d..d0fbdb050b3 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -22,6 +22,8 @@
#define QR_DEFAULT_CACHE_SIZE 134217728
+struct volume_options options[];
+
void
qr_local_free (qr_local_t *local)
{
@@ -3477,6 +3479,7 @@ init (xlator_t *this)
int32_t ret = -1, i = 0;
qr_private_t *priv = NULL;
qr_conf_t *conf = NULL;
+ char *def_val = NULL;
if (!this->children || this->children->next) {
gf_log (this->name, GF_LOG_ERROR,
@@ -3526,7 +3529,21 @@ init (xlator_t *this)
}
}
- conf->cache_size = QR_DEFAULT_CACHE_SIZE;
+ if (xlator_get_volopt_info (&this->volume_options, "cache-size",
+ &def_val, NULL)) {
+ gf_log (this->name, GF_LOG_ERROR, "Default value of "
+ "cache-size not found");
+ ret = -1;
+ goto out;
+ } else {
+ if (gf_string2bytesize (def_val, &conf->cache_size)) {
+ gf_log (this->name, GF_LOG_ERROR, "Default value of "
+ "cache-size corrupt");
+ ret = -1;
+ goto out;
+ }
+ }
+
ret = dict_get_str (this->options, "cache-size", &str);
if (ret == 0) {
ret = gf_string2bytesize (str, &conf->cache_size);
@@ -3618,6 +3635,8 @@ struct volume_options options[] = {
.type = GF_OPTION_TYPE_SIZET,
.min = 0,
.max = 6 * GF_UNIT_GB,
+ .default_value = "128MB",
+ .description = "Size of the read cache."
},
{ .key = {"cache-timeout"},
.type = GF_OPTION_TYPE_INT,