summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/stripe
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2010-10-05 07:02:07 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-05 05:47:38 -0700
commit6b74f3ec7b6e0fed2e253df456b067fc27049117 (patch)
treea4f51f043b8d169bf1be46e7b482fca9f3d29d77 /xlators/cluster/stripe
parent7aec50bdad06665243a16f1ce83a03037bcd5d56 (diff)
Reply back to CLI on error, by validating each xlator's opts
Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1159 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/cluster/stripe')
-rw-r--r--xlators/cluster/stripe/src/stripe.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index 4eb6aebea..a8ac55aa4 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -3735,6 +3735,45 @@ mem_acct_init (xlator_t *this)
out:
return ret;
}
+int
+validate_options (xlator_t *this, dict_t *options, char **op_errstr)
+{
+
+
+ data_t *data = NULL;
+ int ret = 0;
+ stripe_private_t *priv = NULL;
+
+ data = dict_get (options, "block-size");
+ if (data) {
+ gf_log (this->name, GF_LOG_TRACE,"Reconfiguring Stripe"
+ " Block-size");
+ priv = GF_CALLOC (1, sizeof (stripe_private_t),
+ gf_stripe_mt_stripe_private_t);
+ if (!priv) {
+ gf_log ("",GF_LOG_ERROR, "Unable to allocate memory");
+ ret = -1;
+ goto out;
+ }
+
+ ret = set_stripe_block_size (this, priv, data->data);
+ if (ret) {
+ gf_log (this->name, GF_LOG_DEBUG,
+ "Reconfigue: Block-Size reconfiguration failed");
+ *op_errstr = gf_strdup ("Error, could not parse list");
+ ret = -1;
+ goto out;
+ }
+ gf_log (this->name, GF_LOG_TRACE,
+ "Reconfigue: Block-Size reconfigured Successfully");
+ }
+
+out:
+ if (priv)
+ GF_FREE (priv);
+ return ret;
+
+}
int
reconfigure (xlator_t *this, dict_t *options)
@@ -3761,6 +3800,10 @@ reconfigure (xlator_t *this, dict_t *options)
gf_log (this->name, GF_LOG_TRACE,
"Reconfigue: Block-Size reconfigured Successfully");
}
+ else {
+ priv->block_size = (128 * GF_UNIT_KB);
+ }
+
out:
return ret;