summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.h b/xlators/mgmt/glusterd/src/glusterd-store.h
index b381e5a0cce..788949d55fc 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.h
+++ b/xlators/mgmt/glusterd/src/glusterd-store.h
@@ -30,6 +30,7 @@
#include "glusterfs.h"
#include "xlator.h"
+#include "run.h"
#include "logging.h"
#include "call-stub.h"
#include "fd.h"
@@ -73,6 +74,10 @@ typedef enum glusterd_store_ver_ac_{
#define GLUSTERD_STORE_KEY_PEER_HOSTNAME "hostname"
#define GLUSTERD_STORE_KEY_PEER_STATE "state"
+#define GLUSTERD_GET_HOOKS_DIR(path, version, priv) \
+ snprintf (path, PATH_MAX, "%s/hooks/%d", priv->workdir,\
+ version);
+
#define glusterd_for_each_entry(entry, dir) \
do {\
entry = NULL;\
@@ -85,6 +90,7 @@ typedef enum glusterd_store_ver_ac_{
}\
} while (0); \
+
typedef enum {
GD_STORE_SUCCESS,
GD_STORE_KEY_NULL,
@@ -95,6 +101,14 @@ typedef enum {
GD_STORE_STAT_FAILED
} glusterd_store_op_errno_t;
+#define GLUSTERD_HOOK_VER 1
+typedef enum glusterd_commit_hook_type {
+ GD_COMMIT_HOOK_NONE = 0,
+ GD_COMMIT_HOOK_PRE,
+ GD_COMMIT_HOOK_POST,
+ GD_COMMIT_HOOK_MAX
+} glusterd_commit_hook_type_t;
+
int32_t
glusterd_store_volinfo (glusterd_volinfo_t *volinfo, glusterd_volinfo_ver_ac_t ac);
@@ -138,4 +152,13 @@ glusterd_perform_volinfo_version_action (glusterd_volinfo_t *volinfo,
glusterd_volinfo_ver_ac_t ac);
gf_boolean_t
glusterd_store_is_valid_brickpath (char *volname, char *brick);
+
+int
+glusterd_store_create_hooks_directory (char *basedir);
+
+char *
+glusterd_store_get_hooks_cmd_subdir (glusterd_op_t op);
+
+int
+glusterd_store_run_hooks (char *hooks_path, dict_t *op_ctx);
#endif