diff options
author | Csaba Henk <csaba@gluster.com> | 2010-10-03 14:57:11 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-04 02:43:53 -0700 |
commit | 6d9bcd67e99ad638ca260f04cff401e7d9ebe3c5 (patch) | |
tree | c613842489536ebc76cf4d991095962294f5b975 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 609a89ceace25a0a81d0a9cafde3a4d1afd1b916 (diff) |
volgen: impemlent dynamic (pattern-based) option matching
So now auth.addr.*.allow can be a basic option, without any specific support code!
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1750 (clean up volgen)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1750
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 513be5b4d29..7a69d2c9e66 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1047,7 +1047,7 @@ glusterd_op_stage_set_volume (gd1_mgmt_stage_op_req *req) int ret = 0; dict_t *dict = NULL; char *volname = NULL; - gf_boolean_t exists = _gf_false; + int exists = 0; char *key = NULL; char str[100] = {0, }; int count = 0; @@ -1094,7 +1094,7 @@ glusterd_op_stage_set_volume (gd1_mgmt_stage_op_req *req) exists = glusterd_check_option_exists(key); - if (!exists) { + if (exists != 1) { gf_log ("", GF_LOG_ERROR, "Option with name: %s " "does not exist", key); ret = -1; @@ -1168,21 +1168,6 @@ out: } - -gf_boolean_t -glusterd_check_option_exists(char *optstring) -{ - struct volopt_map_entry *vme = NULL; - - for (vme = glusterd_volopt_map; vme->key; vme++) { - if (strcmp (vme->key, optstring) == 0) - return _gf_true; - } - - return _gf_false; - -} - static int glusterd_op_perform_remove_brick (glusterd_volinfo_t *volinfo, char *brick) { @@ -2800,11 +2785,11 @@ void _delete_reconfig_opt (dict_t *this, char *key, data_t *value, void *data) { - gf_boolean_t exists = _gf_false; + int exists = 0; exists = glusterd_check_option_exists(key); - if (exists) { + if (exists == 1) { gf_log ("", GF_LOG_DEBUG, "deleting dict with key=%s,value=%s", key, value->data); dict_del (this, key); |