From 4965109a3c7d456b9f19eb67cf023ba86069e6e7 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 6 May 2013 18:04:47 +0530 Subject: glusterd: Backport of vme table changes from master This patch backports the following changes from the master branch 99fe09f glusterd: Moved the volume entry table to a separate file. e306d08 glusterd: Changing the volume entry table's representation. eac54f6 glusterd: Added option description, and validation function fields. bcb4235 glusterd: Added validation function for performance cache max and min size. 8897d08 glusterd: Added validation function for quota-timeout. 4579609 glusterd: Added validation function for stripe-block-size. 6788bad glusterd: Fix some options in vme table 549231d glusterd: Added the validation function for subvols-per-directory 9636e63 glusterd: Added description for nfs.transport-type option in volume set help. Change-Id: I4a64ad94f17df4b45a3a32262a83e2c35fb5f7da BUG: 907311 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.org/4956 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index da1e8f83f..19f0934cd 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -105,6 +105,8 @@ static char *glusterd_op_sm_event_names[] = { "GD_OP_EVENT_INVALID" }; +extern struct volopt_map_entry glusterd_volopt_map[]; + char* glusterd_op_sm_state_name_get (int state) { @@ -401,7 +403,8 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) uint32_t local_key_op_version = 0; gf_boolean_t origin_glusterd = _gf_true; gf_boolean_t check_op_version = _gf_true; - gf_boolean_t all_vol = _gf_false; + gf_boolean_t all_vol = _gf_false; + struct volopt_map_entry *vme = NULL; GF_ASSERT (dict); this = THIS; @@ -559,6 +562,18 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) if (is_key_glusterd_hooks_friendly (key)) continue; + for (vme = &glusterd_volopt_map[0]; vme->key; vme++) { + if ((vme->validate_fn) && + ((!strcmp (key, vme->key)) || + (!strcmp (key, strchr (vme->key, '.') + 1)))) { + ret = vme->validate_fn (dict, key, value, + op_errstr); + if (ret) + goto out; + break; + } + } + exists = glusterd_check_option_exists (key, &key_fixed); if (exists == -1) { ret = -1; -- cgit