summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorVarsha Rao <varao@redhat.com>2018-03-16 14:23:25 +0530
committerAmar Tumballi <amarts@redhat.com>2018-04-11 10:53:48 +0000
commit909e2cdf06fbd7b4161fff402fc6ef7b5e189c21 (patch)
treeb2190d23646807254b149be54448f136dbd4e143 /xlators/performance
parent0002c36666c9b043a330ee08533a87fe7fd16491 (diff)
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 <varao@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/decompounder/src/decompounder.c6
-rw-r--r--xlators/performance/io-cache/src/io-cache.c13
-rw-r--r--xlators/performance/io-threads/src/io-threads.c13
-rw-r--r--xlators/performance/md-cache/src/md-cache.c29
-rw-r--r--xlators/performance/nl-cache/src/nl-cache.c12
-rw-r--r--xlators/performance/open-behind/src/open-behind.c15
-rw-r--r--xlators/performance/read-ahead/src/read-ahead.c13
-rw-r--r--xlators/performance/readdir-ahead/src/readdir-ahead.c11
8 files changed, 103 insertions, 9 deletions
diff --git a/xlators/performance/decompounder/src/decompounder.c b/xlators/performance/decompounder/src/decompounder.c
index 095a300e9f4..2bc73efdfd3 100644
--- a/xlators/performance/decompounder/src/decompounder.c
+++ b/xlators/performance/decompounder/src/decompounder.c
@@ -916,29 +916,27 @@ mem_acct_init (xlator_t *this)
int32_t
init (xlator_t *this)
{
- int ret = 0;
+ int ret = -1;
if (!this->children) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DC_MSG_VOL_MISCONFIGURED, "Decompounder must have"
" a subvol.");
- ret = -1;
goto out;
}
if (!this->parents) {
gf_msg (this->name, GF_LOG_WARNING, 0,
DC_MSG_VOL_MISCONFIGURED, "Volume is dangling.");
- ret = -1;
goto out;
}
this->local_pool = mem_pool_new (dc_local_t, 128);
if (!this->local_pool) {
- ret = -1;
goto out;
}
+ ret = 0;
out:
return ret;
}
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} },
};
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index 7bdcc624659..4531137c936 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -1160,6 +1160,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("watchdog-secs", conf->watchdog_secs, options,
int32, out);
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ out);
+
if (conf->watchdog_secs > 0) {
start_iot_watchdog (this);
} else {
@@ -1243,6 +1246,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("cleanup-disconnected-reqs",
conf->cleanup_disconnected_reqs, bool, out);
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
+
conf->this = this;
for (i = 0; i < GF_FOP_PRI_MAX; i++) {
@@ -1527,6 +1532,14 @@ struct volume_options options[] = {
.tags = {"io-threads"},
.description = "'Poison' queued requests when a client disconnects"
},
+ { .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-threads"},
+ .description = "Enable/Disable io threads translator"
+ },
{ .key = {NULL},
},
};
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c
index c2d44f63045..0bf97bce802 100644
--- a/xlators/performance/md-cache/src/md-cache.c
+++ b/xlators/performance/md-cache/src/md-cache.c
@@ -2984,16 +2984,24 @@ mdc_reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("cache-ima-xattrs", conf->cache_ima, options, bool,
out);
- GF_OPTION_RECONF ("cache-posix-acl", conf->cache_posix_acl, options, bool, out);
+ GF_OPTION_RECONF ("cache-posix-acl", conf->cache_posix_acl, options,
+ bool, out);
+
GF_OPTION_RECONF ("cache-swift-metadata", conf->cache_swift_metadata,
options, bool, out);
GF_OPTION_RECONF ("cache-samba-metadata", conf->cache_samba_metadata,
options, bool, out);
- GF_OPTION_RECONF ("force-readdirp", conf->force_readdirp, options, bool, out);
+ GF_OPTION_RECONF ("force-readdirp", conf->force_readdirp, options, bool,
+ out);
+
GF_OPTION_RECONF ("cache-invalidation", conf->mdc_invalidation, options,
- bool, out);
+ bool, out);
+
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ out);
+
GF_OPTION_RECONF ("md-cache-statfs", conf->cache_statfs, options,
bool, out);
@@ -3057,9 +3065,12 @@ mdc_init (xlator_t *this)
GF_OPTION_INIT ("cache-samba-metadata", conf->cache_samba_metadata,
bool, out);
- GF_OPTION_INIT("force-readdirp", conf->force_readdirp, bool, out);
+ GF_OPTION_INIT("force-readdirp", conf->force_readdirp, bool, out);
+
GF_OPTION_INIT("cache-invalidation", conf->mdc_invalidation, bool, out);
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
+
pthread_mutex_init (&conf->statfs_cache.lock, NULL);
GF_OPTION_INIT ("md-cache-statfs", conf->cache_statfs, bool, out);
@@ -3286,7 +3297,15 @@ struct volume_options mdc_options[] = {
.description = "A comma separeted list of xattrs that shall be "
"cached by md-cache. The only wildcard allowed is '*'",
},
- { .key = {NULL} },
+ { .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 = {"md-cache"},
+ .description = "Enable/Disable md cache translator"
+ },
+ { .key = {NULL} },
};
diff --git a/xlators/performance/nl-cache/src/nl-cache.c b/xlators/performance/nl-cache/src/nl-cache.c
index 7dd8467b54d..0f0e53bac2b 100644
--- a/xlators/performance/nl-cache/src/nl-cache.c
+++ b/xlators/performance/nl-cache/src/nl-cache.c
@@ -720,6 +720,8 @@ nlc_reconfigure (xlator_t *this, dict_t *options)
options, bool, out);
GF_OPTION_RECONF ("nl-cache-limit", conf->cache_size, options,
size_uint64, out);
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ out);
out:
return 0;
@@ -741,6 +743,7 @@ nlc_init (xlator_t *this)
GF_OPTION_INIT ("nl-cache-positive-entry", conf->positive_entry_cache,
bool, out);
GF_OPTION_INIT ("nl-cache-limit", conf->cache_size, size_uint64, out);
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
/* Since the positive entries are stored as list of refs on
* existing inodes, we should not overflow the inode lru_limit.
@@ -841,6 +844,15 @@ struct volume_options nlc_options[] = {
.flags = OPT_FLAG_SETTABLE | OPT_FLAG_CLIENT_OPT | OPT_FLAG_DOC,
.description = "Time period after which cache has to be refreshed",
},
+ { .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 = {"nl-cache"},
+ .description = "Enable/Disable nl cache translator"
+ },
+
{ .key = {NULL} },
};
diff --git a/xlators/performance/open-behind/src/open-behind.c b/xlators/performance/open-behind/src/open-behind.c
index e5947bd858e..5d5f8099be3 100644
--- a/xlators/performance/open-behind/src/open-behind.c
+++ b/xlators/performance/open-behind/src/open-behind.c
@@ -918,9 +918,12 @@ reconfigure (xlator_t *this, dict_t *options)
bool, out);
GF_OPTION_RECONF ("lazy-open", conf->lazy_open, options, bool, out);
+
GF_OPTION_RECONF ("read-after-open", conf->read_after_open, options,
bool, out);
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ out);
ret = 0;
out:
return ret;
@@ -952,7 +955,11 @@ init (xlator_t *this)
GF_OPTION_INIT ("use-anonymous-fd", conf->use_anonymous_fd, bool, err);
GF_OPTION_INIT ("lazy-open", conf->lazy_open, bool, err);
+
GF_OPTION_INIT ("read-after-open", conf->read_after_open, bool, err);
+
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, err);
+
this->private = conf;
return 0;
@@ -1038,6 +1045,14 @@ struct volume_options options[] = {
.tags = {},
/* option_validation_fn validate_fn; */
},
+ { .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 = {"open-behind"},
+ .description = "Enable/Disable open behind translator"
+ },
{ .key = {NULL} }
};
diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c
index a6c2a68b32e..d001784797a 100644
--- a/xlators/performance/read-ahead/src/read-ahead.c
+++ b/xlators/performance/read-ahead/src/read-ahead.c
@@ -1132,6 +1132,9 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("page-size", conf->page_size, options, size_uint64,
out);
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ out);
+
ret = 0;
out:
return ret;
@@ -1172,6 +1175,8 @@ init (xlator_t *this)
GF_OPTION_INIT ("force-atime-update", conf->force_atime_update, bool, out);
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, out);
+
conf->files.next = &conf->files;
conf->files.prev = &conf->files;
@@ -1280,5 +1285,13 @@ struct volume_options options[] = {
.tags = {"read-ahead"},
.description = "Page size with which read-ahead performs server I/O"
},
+ { .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 = {"read-ahead"},
+ .description = "Enable/Disable read ahead translator"
+ },
{ .key = {NULL} },
};
diff --git a/xlators/performance/readdir-ahead/src/readdir-ahead.c b/xlators/performance/readdir-ahead/src/readdir-ahead.c
index db20c211ae6..8e1c0de1c44 100644
--- a/xlators/performance/readdir-ahead/src/readdir-ahead.c
+++ b/xlators/performance/readdir-ahead/src/readdir-ahead.c
@@ -600,6 +600,8 @@ reconfigure(xlator_t *this, dict_t *options)
size_uint64, err);
GF_OPTION_RECONF("parallel-readdir", priv->parallel_readdir, options,
bool, err);
+ GF_OPTION_RECONF ("pass-through", this->pass_through, options, bool,
+ err);
return 0;
err:
@@ -647,6 +649,7 @@ init(xlator_t *this)
err);
GF_OPTION_INIT("parallel-readdir", priv->parallel_readdir, bool,
err);
+ GF_OPTION_INIT ("pass-through", this->pass_through, bool, err);
return 0;
@@ -725,6 +728,14 @@ struct volume_options options[] = {
"the performance improvement is higher in large "
"clusters"
},
+ { .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 = {"readdir-ahead"},
+ .description = "Enable/Disable readdir ahead translator"
+ },
{ .key = {NULL} },
};