From 67740785050158dad8793f8d0ab6beeb30f99b3f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 25 May 2012 16:13:41 +0530 Subject: glusterd-hooks: added support for separate namespace for 'volume set' keys The keys in the above mentioned namespace could be used by hook scripts to peform tasks on 'special' keys as defined by the storage admin. The choice of the key and its semantics of it are outside the scope of glusterd. It is the responsibility of the storage admin to keep the meaning of the key(s) consistent. If a user gives a command like 'gluster volume set user.for-this-key do-this" scripts would get 'user.for-this-key=do-this' as argument. Change-Id: I5509e17d99e4ddd8bf5df968dcd51ff9a80dc3ab Signed-off-by: Amar Tumballi BUG: 825902 Reviewed-on: http://review.gluster.com/3443 Tested-by: Gluster Build System Reviewed-by: Krishnan Parthasarathi Reviewed-by: Anand Avati --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (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 f727a76eb58..9b635f0216f 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -415,6 +415,12 @@ glusterd_op_stage_set_volume (dict_t *dict, char **op_errstr) ret = 0; goto out; } + + if (is_key_glusterd_hooks_friendly (this, volname, key)) { + ret = 0; + goto out; + } + exists = glusterd_check_option_exists (key, &key_fixed); if (exists == -1) { ret = -1; @@ -1106,6 +1112,12 @@ glusterd_op_set_volume (dict_t *dict) &volinfo->memory_accounting); goto out; } + + if (is_key_glusterd_hooks_friendly (this, volname, key)) { + ret = 0; + goto out; + } + ret = glusterd_check_option_exists (key, &key_fixed); GF_ASSERT (ret); if (ret == -1) { -- cgit