summaryrefslogtreecommitdiffstats
path: root/xlators/lib/src/libxlator.h
diff options
context:
space:
mode:
authorKaushik BV <kaushikbv@gluster.com>2011-01-27 05:23:30 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-01-27 03:16:51 -0800
commit73bce15b61755509de23d32646135254d369a2f6 (patch)
tree921b92f6d3e549b1e6dd68bc886cc727caec5429 /xlators/lib/src/libxlator.h
parent11dd59b788334fe2de1653ae85395986ba531606 (diff)
adding libxlator, to ensure proper client side aggregation of marks by clustering translators
Signed-off-by: Kaushik BV <kaushikbv@gluster.com> Signed-off-by: Csaba Henk <csaba@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2310 (georeplication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2310
Diffstat (limited to 'xlators/lib/src/libxlator.h')
-rw-r--r--xlators/lib/src/libxlator.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/xlators/lib/src/libxlator.h b/xlators/lib/src/libxlator.h
new file mode 100644
index 00000000000..be8a0093695
--- /dev/null
+++ b/xlators/lib/src/libxlator.h
@@ -0,0 +1,86 @@
+#ifndef _LIBXLATOR_H
+#define _LIBXLATOR_H
+
+
+#ifndef _CONFIG_H
+#define _CONFIG_H
+#include "config.h"
+#endif
+
+#include "xlator.h"
+#include "logging.h"
+#include "defaults.h"
+#include "common-utils.h"
+#include "compat.h"
+#include "compat-errno.h"
+
+
+#define MARKER_XATTR_PREFIX "trusted.glusterfs"
+#define XTIME "xtime"
+#define VOLUME_MARK "volume-mark"
+#define GF_XATTR_MARKER_KEY MARKER_XATTR_PREFIX "." VOLUME_MARK
+#define UUID_SIZE 36
+#define MARKER_UUID_TYPE 1
+#define MARKER_XTIME_TYPE 2
+
+
+typedef int32_t (*xlator_specf_unwind_t) (void *getxattr, call_frame_t *frame,
+ int op_ret, int op_errno, dict_t *dict);
+
+
+struct volume_mark {
+ uint8_t major;
+ uint8_t minor;
+ uint8_t uuid[16];
+ uint8_t retval;
+ uint32_t sec;
+ uint32_t usec;
+}__attribute__ ((__packed__));
+
+struct marker_str {
+ struct volume_mark *volmark;
+ data_t *data;
+
+ uint32_t host_timebuf[2];
+ uint32_t net_timebuf[2];
+ int32_t call_count;
+ unsigned has_xtime:1;
+ int32_t enoent_count;
+ int32_t enotconn_count;
+
+ xlator_specf_unwind_t xl_specf_unwind;
+ void *xl_local;
+ char *vol_uuid;
+};
+
+static inline gf_boolean_t
+marker_has_volinfo (struct marker_str *marker)
+{
+ if (marker->volmark)
+ return _gf_true;
+ else
+ return _gf_false;
+}
+
+int32_t
+cluster_markerxtime_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *dict);
+
+int32_t
+cluster_markeruuid_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
+ int op_ret, int op_errno, dict_t *dict);
+
+int32_t
+cluster_getmarkerattr (call_frame_t *frame,xlator_t *this, loc_t *loc,
+ const char *name, void *xl_local,
+ xlator_specf_unwind_t xl_specf_getxattr_unwind,
+ xlator_t **sub_volumes, int count, int type,
+ char *vol_uuid);
+
+int
+match_uuid_local (const char *name, char *uuid);
+
+
+
+
+#endif /* !_LIBXLATOR_H */