summaryrefslogtreecommitdiffstats
path: root/glfs-operations.h
diff options
context:
space:
mode:
Diffstat (limited to 'glfs-operations.h')
-rw-r--r--glfs-operations.h55
1 files changed, 46 insertions, 9 deletions
diff --git a/glfs-operations.h b/glfs-operations.h
index ceadcd7..8fe1bd6 100644
--- a/glfs-operations.h
+++ b/glfs-operations.h
@@ -22,19 +22,56 @@
# include "rpc/block.h"
+typedef enum Metakey {
+ GBID = 0,
+ SIZE = 1,
+ HA = 2,
+ ENTRYCREATE = 3,
-typedef struct glusterBlockDef {
- char *volume;
- char *host; /* TODO: use proper Transport Object */
- char *filename;
+ METAKEY__MAX = 4 /* Updata this when add new Key */
+} Metakey;
+
+
+typedef struct NodeInfo {
+ char addr[255];
+ char status[16];
+} NodeInfo;
+
+typedef struct MetaInfo {
+ char gbid[38];
size_t size;
- bool status;
-} glusterBlockDef;
-typedef glusterBlockDef *glusterBlockDefPtr;
+ size_t mpath;
+ char entry[16];
+
+ size_t nhosts;
+ NodeInfo **list;
+} MetaInfo;
+
+static const char *const MetakeyLookup[] = {
+ [GBID] = "GBID",
+ [SIZE] = "SIZE",
+ [HA] = "HA",
+ [ENTRYCREATE] = "ENTRYCREATE",
+ [METAKEY__MAX] = NULL,
+};
+
+
+struct glfs *
+glusterBlockVolumeInit(char *volume, char *volfileserver);
+
+int
+glusterBlockCreateEntry(blockCreateCli *blk, char *gbid);
+
+int
+glusterBlockDeleteEntry(blockCreate *blk);
+struct glfs_fd *
+glusterBlockCreateMetaLockFile(struct glfs *glfs);
-int glusterBlockCreateEntry(blockCreateCli *blk, char *gbid);
+void
+blockGetMetaInfo(struct glfs *glfs, char *metafile, MetaInfo *info);
-int glusterBlockDeleteEntry(blockCreate *blk);
+void
+blockFreeMetaInfo(MetaInfo *info);
#endif /* _GLFS_OPERATIONS_H */