summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/options.h
diff options
context:
space:
mode:
authorCsaba Henk <csaba@redhat.com>2012-06-01 15:00:16 +0530
committerAnand Avati <avati@redhat.com>2012-06-01 15:18:26 -0700
commited6aba9463e2d247edef0eaa6248d6036fbb810b (patch)
tree73601b29b225702770b16bd984cde73c14e56a81 /libglusterfs/src/options.h
parent0ebe766bd4211466c4f89b7d48baa0cdaaac08ed (diff)
core: xlator option framework cleanups
- Upon init/reconf, if an option is not in the opt dict, and a default value is neither specified, null it out. With this, the xlator config data that comes out of init/reconf becomes deterministic in terms of the xlator option declarations and the incoming option value dictionary. (Needed for correct operation of volume reset.) - We can rely bravely on the guarantee given by init/reconf as of which no NULL value is passed to the converter functions. Drop the spurious null check of not_null(), and rebaptize it to pass(). Change-Id: Ifa068bcc0275456c01ed00a3a315a985eb262e49 BUG: 765147 Signed-off-by: Csaba Henk <csaba@redhat.com> Reviewed-on: http://review.gluster.com/3505 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/options.h')
-rw-r--r--libglusterfs/src/options.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h
index 01d2a9d5f1b..8c0ff2499c9 100644
--- a/libglusterfs/src/options.h
+++ b/libglusterfs/src/options.h
@@ -131,6 +131,7 @@ xlator_option_init_##type (xlator_t *this, dict_t *options, char *key, \
if (!value) { \
gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
key); \
+ *val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \
@@ -209,6 +210,7 @@ xlator_option_reconf_##type (xlator_t *this, dict_t *options, char *key, \
if (!value) { \
gf_log (this->name, GF_LOG_TRACE, "option %s not set", \
key); \
+ *val_p = (type_t)0; \
return 0; \
} \
if (value == def_value) { \