From 8e0d48cbb23cf056277ebc609d47b5184b95fa87 Mon Sep 17 00:00:00 2001 From: "Anand V. Avati" Date: Mon, 13 Apr 2009 18:42:36 +0530 Subject: use ctx->page_size in all translators and transports instead of having their own configurations Signed-off-by: Anand V. Avati --- xlators/performance/read-ahead/src/read-ahead.c | 28 ++----------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'xlators/performance/read-ahead') diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 39475d2c966..6d015f70ba3 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -768,7 +768,6 @@ init (xlator_t *this) { ra_conf_t *conf; dict_t *options = this->options; - char *page_size_string = NULL; char *page_count_string = NULL; if (!this->children || this->children->next) { @@ -784,27 +783,9 @@ init (xlator_t *this) conf = (void *) CALLOC (1, sizeof (*conf)); ERR_ABORT (conf); - conf->page_size = 256 * 1024; - conf->page_count = 2; + conf->page_size = this->ctx->page_size; + conf->page_count = 4; - if (dict_get (options, "page-size")) - page_size_string = data_to_str (dict_get (options, - "page-size")); - if (page_size_string) - { - if (gf_string2bytesize (page_size_string, &conf->page_size) != 0) - { - gf_log ("read-ahead", - GF_LOG_ERROR, - "invalid number format \"%s\" of \"option page-size\"", - page_size_string); - return -1; - } - - gf_log (this->name, GF_LOG_DEBUG, "Using conf->page_size = %"PRIu64"", - conf->page_size); - } - if (dict_get (options, "page-count")) page_count_string = data_to_str (dict_get (options, "page-count")); @@ -878,11 +859,6 @@ struct volume_options options[] = { { .key = {"force-atime-update"}, .type = GF_OPTION_TYPE_BOOL }, - { .key = {"page-size"}, - .type = GF_OPTION_TYPE_SIZET, - .min = 64 * GF_UNIT_KB, - .max = 2 * GF_UNIT_MB - }, { .key = {"page-count"}, .type = GF_OPTION_TYPE_INT, .min = 1, -- cgit