From ed6aba9463e2d247edef0eaa6248d6036fbb810b Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Fri, 1 Jun 2012 15:00:16 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/3505 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/options.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libglusterfs/src/options.h') diff --git a/libglusterfs/src/options.h b/libglusterfs/src/options.h index 01d2a9d5f..8c0ff2499 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) { \ -- cgit