summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-09 05:38:46 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-11 22:24:32 -0700
commit0b501ac95edc0ef5945228eb47e6482cfc4efa41 (patch)
tree58fa16eb100868a65e754f704b2a19817250ca91 /xlators/mgmt/glusterd/src/glusterd.h
parent6ff316dca7c9eebab14e71b6ad0908c2e45a5ee2 (diff)
'gluster volume rebalance' related fixes
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1307 (gluster volume defrag <VOLNAME> status) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1307
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 368c0a6847a..dce3275e73c 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -25,7 +25,10 @@
#include "config.h"
#endif
+#include <sys/types.h>
+#include <dirent.h>
#include <pthread.h>
+
#include "uuid.h"
#include "rpc-clnt.h"
@@ -84,6 +87,33 @@ struct glusterd_brickinfo {
typedef struct glusterd_brickinfo glusterd_brickinfo_t;
+struct gf_defrag_brickinfo_ {
+ char *name;
+ int files;
+ int size;
+};
+
+typedef enum gf_defrag_status_ {
+ GF_DEFRAG_STATUS_NOT_STARTED,
+ GF_DEFRAG_STATUS_STARTED,
+ GF_DEFRAG_STATUS_STOPED,
+ GF_DEFRAG_STATUS_COMPLETE,
+} gf_defrag_status_t;
+
+struct glusterd_defrag_info_ {
+ uint64_t total_files;
+ uint64_t total_data;
+ uint64_t num_files_lookedup;
+ gf_lock_t lock;
+ pthread_t th;
+ char mount[1024];
+ char databuf[131072];
+ struct gf_defrag_brickinfo_ *bricks; /* volinfo->brick_count */
+};
+
+
+typedef struct glusterd_defrag_info_ glusterd_defrag_info_t;
+
struct glusterd_volinfo_ {
char volname[GLUSTERD_MAX_VOLUME_NAME];
int type;
@@ -94,6 +124,13 @@ struct glusterd_volinfo_ {
int sub_count;
int port;
glusterd_store_handle_t *shandle;
+
+ /* Defrag/rebalance related */
+ gf_defrag_status_t defrag_status;
+ uint64_t rebalance_files;
+ uint64_t rebalance_data;
+ uint64_t lookedup_files;
+ glusterd_defrag_info_t *defrag;
};
typedef struct glusterd_volinfo_ glusterd_volinfo_t;