summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/glusterfs.h
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-08-02 13:14:25 +0530
committerAnand Avati <avati@redhat.com>2012-08-03 02:01:52 -0700
commited4b76ba9c545f577287c0e70ae3cc853a0d5f3f (patch)
treedeffb91a0cee620ac7fcc8c7914dbca73668574e /libglusterfs/src/glusterfs.h
parent66205114267ec659b4ad8084c7e9497009529c61 (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/glusterfs.h')
-rw-r--r--libglusterfs/src/glusterfs.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index ad3bae14bf4..70a50af6a5b 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -33,9 +33,9 @@
#include <sys/poll.h>
#include <pthread.h>
-
#include "list.h"
#include "logging.h"
+#include "lkowner.h"
#define GF_YES 1
#define GF_NO 0
@@ -134,6 +134,8 @@
* we have to add aux-gid in payload of actors */
#define GF_MAX_AUX_GROUPS 200
+#define GF_UUID_BUF_SIZE 50
+
/* NOTE: add members ONLY at the end (just before _MAXVALUE) */
typedef enum {
GF_FOP_NULL = 0,
@@ -379,14 +381,21 @@ struct _glusterfs_ctx {
glusterfsd_mgmt_event_notify_fn_t notify; /* Used for xlators to make
call to fsd-mgmt */
+ gf_log_handle_t log; /* all logging related variables */
+
+ pthread_key_t synctask_key;
+ pthread_key_t uuid_buf_key;
+ char uuid_buf[GF_UUID_BUF_SIZE];
+ pthread_key_t lkowner_buf_key;
+ char lkowner_buf[GF_LKOWNER_BUF_SIZE];
+
+ int mem_acct_enable;
+
};
typedef struct _glusterfs_ctx glusterfs_ctx_t;
glusterfs_ctx_t *glusterfs_ctx_new (void);
-/* If you edit this structure then, make a corresponding change in
- * globals.c in the eventstring.
- */
typedef enum {
GF_EVENT_PARENT_UP = 1,
GF_EVENT_POLLIN,
@@ -408,9 +417,6 @@ typedef enum {
GF_EVENT_MAXVAL,
} glusterfs_event_t;
-/* gf_lkowner_t is defined in lkowner.h */
-#include "lkowner.h"
-
struct gf_flock {
short l_type;
short l_whence;
@@ -420,8 +426,6 @@ struct gf_flock {
gf_lkowner_t l_owner;
};
-extern char *glusterfs_strevent (glusterfs_event_t ev);
-
#define GF_MUST_CHECK __attribute__((warn_unused_result))
/*
* Some macros (e.g. ALLOC_OR_GOTO) set variables in function scope, but the