From 000e65d7af7be31236e060064fb3b4a332e78cf3 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 13 Nov 2012 01:14:43 +0530 Subject: core: remove all the 'inner' functions in codebase * move 'dict_keys_join()' from api/glfs_fops.c to libglusterfs/dict.c - also added an argument which is treated as a filter function if required, currently useful for fuse. * now 'make CFLAGS="-std=gnu99 -pedantic" 2>&1 | grep nested' gives no output. Change-Id: I4e18496fbd93ae1d3942026ef4931889cba015e8 Signed-off-by: Amar Tumballi BUG: 875913 Reviewed-on: http://review.gluster.org/4187 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/protocol/server/src/authenticate.c | 45 +++++++++++++++++------------- 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'xlators/protocol/server/src/authenticate.c') diff --git a/xlators/protocol/server/src/authenticate.c b/xlators/protocol/server/src/authenticate.c index 9c843d0bb45..eb6deb80149 100644 --- a/xlators/protocol/server/src/authenticate.c +++ b/xlators/protocol/server/src/authenticate.c @@ -124,34 +124,41 @@ fini (dict_t *this, char *key, data_t *value, void *data) return 0; } +static int +_gf_auth_option_validate (dict_t *d, char *k, data_t *v, void *tmp) +{ + auth_handle_t *handle = NULL; + xlator_t *xl = NULL; + int ret = 0; + + xl = tmp; + + handle = data_to_ptr (v); + if (!handle) + return 0; + + list_add_tail (&(handle->vol_opt->list), &(xl->volume_options)); + + ret = xlator_options_validate_list (xl, xl->options, + handle->vol_opt, NULL); + if (ret) { + gf_log ("authenticate", GF_LOG_ERROR, + "volume option validation failed"); + return -1; + } + return 0; +} + int32_t gf_auth_init (xlator_t *xl, dict_t *auth_modules) { int ret = 0; - auth_handle_t *handle = NULL; dict_foreach (auth_modules, init, &ret); if (ret) goto out; - int _auth_option_validate (dict_t *d, char *k, data_t *v, void *tmp) - { - handle = data_to_ptr (v); - if (!handle) - return 0; - - list_add_tail (&(handle->vol_opt->list), - &(xl->volume_options)); - ret = xlator_options_validate_list (xl, xl->options, - handle->vol_opt, NULL); - if (ret) { - gf_log ("authenticate", GF_LOG_ERROR, - "volume option validation failed"); - return -1; - } - return 0; - } - ret = dict_foreach (auth_modules, _auth_option_validate, NULL); + ret = dict_foreach (auth_modules, _gf_auth_option_validate, xl); out: if (ret) { -- cgit