From 909e2cdf06fbd7b4161fff402fc6ef7b5e189c21 Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Fri, 16 Mar 2018 14:23:25 +0530 Subject: xlators/performance: Add pass-through option Add pass-through option in performance traslators. Set the option in GF_OPTION_INIT() and GF_OPTION_RECONF() Updates: #304 Change-Id: If1537450147d154905831e36f7162a32866d7ad6 Signed-off-by: Varsha Rao --- xlators/performance/io-cache/src/io-cache.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'xlators/performance/io-cache/src/io-cache.c') diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index baef1e1e970..1614166d973 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1664,6 +1664,9 @@ reconfigure (xlator_t *this, dict_t *options) ioc_table_lock (table); { + GF_OPTION_RECONF ("pass-through", this->pass_through, options, + bool, out); + GF_OPTION_RECONF ("cache-timeout", table->cache_timeout, options, int32, unlock); @@ -1762,6 +1765,8 @@ init (xlator_t *this) table->xl = this; table->page_size = this->ctx->page_size; + GF_OPTION_INIT ("pass-through", this->pass_through, bool, out); + GF_OPTION_INIT ("cache-size", table->cache_size, size_uint64, out); GF_OPTION_INIT ("cache-timeout", table->cache_timeout, int32, out); @@ -2196,5 +2201,13 @@ struct volume_options options[] = { .op_version = {1}, .flags = OPT_FLAG_CLIENT_OPT | OPT_FLAG_SETTABLE | OPT_FLAG_DOC }, + { .key = {"pass-through"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "false", + .op_version = {GD_OP_VERSION_4_1_0}, + .flags = OPT_FLAG_SETTABLE | OPT_FLAG_DOC | OPT_FLAG_CLIENT_OPT, + .tags = {"io-cache"}, + .description = "Enable/Disable io cache translator" + }, { .key = {NULL} }, }; -- cgit