From 86433c25b61073f244cde0bf80a7857b57ab1265 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Fri, 26 Dec 2014 10:36:00 +0530 Subject: mgmt/glusterd: Add option to enable lock trace Change-Id: I24ed0f866d53e91a8323c043a38f73207cbfd7d2 BUG: 1168189 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/9351 Reviewed-by: Krutika Dhananjay Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/features/locks/src/posix.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'xlators/features/locks') diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index af25a10aaa3..603bc585b4d 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -2592,6 +2592,20 @@ pl_client_destroy_cbk (xlator_t *this, client_t *client) return 0; } +int +reconfigure (xlator_t *this, dict_t *options) +{ + posix_locks_private_t *priv = NULL; + int ret = -1; + + priv = this->private; + + GF_OPTION_RECONF ("trace", priv->trace, options, bool, out); + + ret = 0; +out: + return ret; +} int init (xlator_t *this) @@ -2599,7 +2613,6 @@ init (xlator_t *this) posix_locks_private_t *priv = NULL; xlator_list_t *trav = NULL; data_t *mandatory = NULL; - data_t *trace = NULL; int ret = -1; if (!this->children || this->children->next) { @@ -2632,15 +2645,7 @@ init (xlator_t *this) gf_log (this->name, GF_LOG_WARNING, "mandatory locks not supported in this minor release."); - trace = dict_get (this->options, "trace"); - if (trace) { - if (gf_string2boolean (trace->data, - &priv->trace) == -1) { - gf_log (this->name, GF_LOG_ERROR, - "'trace' takes on only boolean values."); - goto out; - } - } + GF_OPTION_INIT ("trace", priv->trace, bool, out); this->local_pool = mem_pool_new (pl_local_t, 32); if (!this->local_pool) { -- cgit