diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-16 09:39:21 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-17 11:57:39 -0700 |
commit | abc2a6b0b91a82bb59327cd2a4ca72b8954e1425 (patch) | |
tree | 5c2e73211332d2ba431d17600fdc936f434da15c /libglusterfs/src/globals.c | |
parent | ca6528592eed88ff1598b25f1aaa1c99c14a2e32 (diff) |
glusterfsd: log enhancement
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2346 (Log message enhancements in GlusterFS - phase 1)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
Diffstat (limited to 'libglusterfs/src/globals.c')
-rw-r--r-- | libglusterfs/src/globals.c | 82 |
1 files changed, 16 insertions, 66 deletions
diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index 10f370b5c53..90e4bc41336 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -211,63 +211,6 @@ glusterfs_this_set (xlator_t *this) return 0; } - -/* IS_CENTRAL_LOG */ - -static pthread_key_t central_log_flag_key; - -void -glusterfs_central_log_flag_destroy (void *ptr) -{ - if (ptr) - FREE (ptr); -} - - -int -glusterfs_central_log_flag_init () -{ - int ret = 0; - - ret = pthread_key_create (¢ral_log_flag_key, - glusterfs_central_log_flag_destroy); - - if (ret != 0) { - return ret; - } - - pthread_setspecific (central_log_flag_key, (void *) 0); - - return ret; -} - - -void -glusterfs_central_log_flag_set () -{ - pthread_setspecific (central_log_flag_key, (void *) 1); -} - - -long -glusterfs_central_log_flag_get () -{ - long flag = 0; - - flag = (long) pthread_getspecific (central_log_flag_key); - - return flag; -} - - -void -glusterfs_central_log_flag_unset () -{ - pthread_setspecific (central_log_flag_key, (void *) 0); -} - - - /* SYNCTASK */ static pthread_key_t synctask_key; @@ -352,27 +295,34 @@ glusterfs_globals_init () gf_log_globals_init (); ret = glusterfs_ctx_init (); - if (ret) + if (ret) { + gf_log ("", GF_LOG_CRITICAL, + "ERROR: glusterfs context init failed"); goto out; + } ret = glusterfs_this_init (); - if (ret) - goto out; - - ret = glusterfs_central_log_flag_init (); - if (ret) + if (ret) { + gf_log ("", GF_LOG_CRITICAL, + "ERROR: glusterfs-translator init failed"); goto out; + } ret = glusterfs_uuid_buf_init (); - if(ret) + if(ret) { + gf_log ("", GF_LOG_CRITICAL, + "ERROR: glusterfs uuid buffer init failed"); goto out; + } gf_mem_acct_enable_set (); ret = synctask_init (); - if (ret) + if (ret) { + gf_log ("", GF_LOG_CRITICAL, + "ERROR: glusterfs synctask init failed"); goto out; - + } out: return ret; } |