From ed4b76ba9c545f577287c0e70ae3cc853a0d5f3f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Thu, 2 Aug 2012 13:14:25 +0530 Subject: core: reduce the usage of global variables * move all the 'logging' related global variables into ctx * make gf_fop_list a 'const' global array, hence no init(), no edits. * make sure ctx is allocated without any dependancy on memory-accounting infrastructure, so it can be the first one to get allocated * globals_init() should happen with ctx as argument not yet fixed below in this patchset: * anything with 'THIS' related globals * anything related to compat_errno related globals as its one time init'd and not changed later on. * statedump related globals Change-Id: Iab8fc30d4bfdbded6741d66ff1ed670fdc7b7ad2 Signed-off-by: Amar Tumballi BUG: 764890 Reviewed-on: http://review.gluster.com/3767 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- libglusterfs/src/stack.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libglusterfs/src/stack.c') diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c index 1579e097457..5349eaa0b01 100644 --- a/libglusterfs/src/stack.c +++ b/libglusterfs/src/stack.c @@ -103,7 +103,8 @@ gf_proc_dump_call_stack (call_stack_t *call_stack, const char *key_buf,...) gf_proc_dump_write("lk-owner", "%s", lkowner_utoa (&call_stack->lk_owner)); if (call_stack->type == GF_OP_TYPE_FOP) - gf_proc_dump_write("op", "%s", gf_fop_list[call_stack->op]); + gf_proc_dump_write("op", "%s", + (char *)gf_fop_list[call_stack->op]); else gf_proc_dump_write("op", "stack"); @@ -277,7 +278,7 @@ gf_proc_dump_call_stack_to_dict (call_stack_t *call_stack, snprintf (key, sizeof (key), "%s.op", prefix); if (call_stack->type == GF_OP_TYPE_FOP) ret = dict_set_str (dict, key, - gf_fop_list[call_stack->op]); + (char *)gf_fop_list[call_stack->op]); else ret = dict_set_str (dict, key, "other"); -- cgit