diff options
author | Amar Tumballi <amarts@redhat.com> | 2012-08-02 13:14:25 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-08-03 02:01:52 -0700 |
commit | ed4b76ba9c545f577287c0e70ae3cc853a0d5f3f (patch) | |
tree | deffb91a0cee620ac7fcc8c7914dbca73668574e /libglusterfs/src/globals.h | |
parent | 66205114267ec659b4ad8084c7e9497009529c61 (diff) |
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 <amarts@redhat.com>
BUG: 764890
Reviewed-on: http://review.gluster.com/3767
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/globals.h')
-rw-r--r-- | libglusterfs/src/globals.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libglusterfs/src/globals.h b/libglusterfs/src/globals.h index 7ccdb4a1498..47a81afb808 100644 --- a/libglusterfs/src/globals.h +++ b/libglusterfs/src/globals.h @@ -18,21 +18,22 @@ /* THIS */ #define THIS (*__glusterfs_this_location()) -#define GF_UUID_BUF_SIZE 50 - xlator_t **__glusterfs_this_location (); xlator_t *glusterfs_this_get (); int glusterfs_this_set (xlator_t *); /* task */ void *synctask_get (); -int synctask_set (void *); +int synctask_set (glusterfs_ctx_t *, void *); /* uuid_buf */ -char *glusterfs_uuid_buf_get(); -char *glusterfs_lkowner_buf_get(); +char *glusterfs_uuid_buf_get(glusterfs_ctx_t *); +/* lkowner_buf */ +char *glusterfs_lkowner_buf_get(glusterfs_ctx_t *); /* init */ -int glusterfs_globals_init (void); +int glusterfs_globals_init (glusterfs_ctx_t *ctx); + +extern const char *gf_fop_list[]; #endif /* !_GLOBALS_H */ |