summaryrefslogtreecommitdiffstats
path: root/xlators/experimental
diff options
context:
space:
mode:
authorGluster Ant <bugzilla-bot@gluster.org>2018-09-12 17:22:48 +0530
committerNigel Babu <nigelb@redhat.com>2018-09-12 17:22:48 +0530
commit45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch)
tree2a5a9b73bae47ab53a41166fd041a06612587f48 /xlators/experimental
parentbe77dbbda692792335a8e9e7c02e0c281f003c40 (diff)
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'xlators/experimental')
-rw-r--r--xlators/experimental/fdl/src/fdl.h18
-rw-r--r--xlators/experimental/jbr-client/src/jbr-messages.h15
-rw-r--r--xlators/experimental/jbr-client/src/jbrc.h14
-rw-r--r--xlators/experimental/jbr-server/src/jbr-internal.h147
4 files changed, 93 insertions, 101 deletions
diff --git a/xlators/experimental/fdl/src/fdl.h b/xlators/experimental/fdl/src/fdl.h
index 32e38c93f2d..827db9f1246 100644
--- a/xlators/experimental/fdl/src/fdl.h
+++ b/xlators/experimental/fdl/src/fdl.h
@@ -11,20 +11,20 @@
#ifndef _FDL_H_
#define _FDL_H_
-#define NEW_REQUEST (uint8_t)'N'
+#define NEW_REQUEST (uint8_t)'N'
typedef struct {
- uint8_t event_type; /* e.g. NEW_REQUEST */
- uint8_t fop_type; /* e.g. GF_FOP_SETATTR */
- uint16_t request_id;
- uint32_t ext_length;
+ uint8_t event_type; /* e.g. NEW_REQUEST */
+ uint8_t fop_type; /* e.g. GF_FOP_SETATTR */
+ uint16_t request_id;
+ uint32_t ext_length;
} event_header_t;
enum {
- FDL_IPC_BASE = 0xfeedbee5, /* ... and they make honey */
- FDL_IPC_CHANGE_TERM,
- FDL_IPC_GET_TERMS,
- FDL_IPC_JBR_SERVER_ROLLBACK
+ FDL_IPC_BASE = 0xfeedbee5, /* ... and they make honey */
+ FDL_IPC_CHANGE_TERM,
+ FDL_IPC_GET_TERMS,
+ FDL_IPC_JBR_SERVER_ROLLBACK
};
#endif /* _FDL_H_ */
diff --git a/xlators/experimental/jbr-client/src/jbr-messages.h b/xlators/experimental/jbr-client/src/jbr-messages.h
index 9f210184d81..ecbf569ec13 100644
--- a/xlators/experimental/jbr-client/src/jbr-messages.h
+++ b/xlators/experimental/jbr-client/src/jbr-messages.h
@@ -23,17 +23,8 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(JBR,
- J_MSG_INIT_FAIL,
- J_MSG_RETRY_MSG,
- J_MSG_MEM_ERR,
- J_MSG_DICT_FLR,
- J_MSG_GENERIC,
- J_MSG_INVALID,
- J_MSG_NO_DATA,
- J_MSG_SYS_CALL_FAILURE,
- J_MSG_QUORUM_NOT_MET,
- J_MSG_LOCK_FAILURE
-);
+GLFS_MSGID(JBR, J_MSG_INIT_FAIL, J_MSG_RETRY_MSG, J_MSG_MEM_ERR, J_MSG_DICT_FLR,
+ J_MSG_GENERIC, J_MSG_INVALID, J_MSG_NO_DATA, J_MSG_SYS_CALL_FAILURE,
+ J_MSG_QUORUM_NOT_MET, J_MSG_LOCK_FAILURE);
#endif /* _JBR_MESSAGES_H_ */
diff --git a/xlators/experimental/jbr-client/src/jbrc.h b/xlators/experimental/jbr-client/src/jbrc.h
index c83259ca1bd..f99178402b3 100644
--- a/xlators/experimental/jbr-client/src/jbrc.h
+++ b/xlators/experimental/jbr-client/src/jbrc.h
@@ -12,16 +12,16 @@
#define _JBRC_H_
typedef struct {
- xlator_t *active;
- uint8_t up_children;
- uint8_t n_children;
- uint32_t kid_state;
+ xlator_t *active;
+ uint8_t up_children;
+ uint8_t n_children;
+ uint32_t kid_state;
} jbrc_private_t;
typedef struct {
- call_stub_t *stub;
- xlator_t *curr_xl;
- uint16_t scars;
+ call_stub_t *stub;
+ xlator_t *curr_xl;
+ uint16_t scars;
} jbrc_local_t;
#endif /* _JBRC_H_ */
diff --git a/xlators/experimental/jbr-server/src/jbr-internal.h b/xlators/experimental/jbr-server/src/jbr-internal.h
index 46a29910d1f..f225e988a5f 100644
--- a/xlators/experimental/jbr-server/src/jbr-internal.h
+++ b/xlators/experimental/jbr-server/src/jbr-internal.h
@@ -11,82 +11,82 @@
#include <sys/stat.h>
#include <sys/types.h>
-#define LEADER_XATTR "user.jbr.leader"
-#define SECOND_CHILD(xl) (xl->children->next->xlator)
-#define RECONCILER_PATH JBR_SCRIPT_PREFIX"/reconciler.py"
-#define CHANGELOG_ENTRY_SIZE 128
+#define LEADER_XATTR "user.jbr.leader"
+#define SECOND_CHILD(xl) (xl->children->next->xlator)
+#define RECONCILER_PATH JBR_SCRIPT_PREFIX "/reconciler.py"
+#define CHANGELOG_ENTRY_SIZE 128
enum {
- gf_mt_jbr_private_t = gf_common_mt_end + 1,
- gf_mt_jbr_fd_ctx_t,
- gf_mt_jbr_inode_ctx_t,
- gf_mt_jbr_dirty_t,
- gf_mt_jbr_end
+ gf_mt_jbr_private_t = gf_common_mt_end + 1,
+ gf_mt_jbr_fd_ctx_t,
+ gf_mt_jbr_inode_ctx_t,
+ gf_mt_jbr_dirty_t,
+ gf_mt_jbr_end
};
typedef enum jbr_recon_notify_ev_id_t {
- JBR_RECON_SET_LEADER = 1,
- JBR_RECON_ADD_CHILD = 2
+ JBR_RECON_SET_LEADER = 1,
+ JBR_RECON_ADD_CHILD = 2
} jbr_recon_notify_ev_id_t;
typedef struct _jbr_recon_notify_ev_s {
- jbr_recon_notify_ev_id_t id;
- uint32_t index; /* in case of add */
- struct list_head list;
+ jbr_recon_notify_ev_id_t id;
+ uint32_t index; /* in case of add */
+ struct list_head list;
} jbr_recon_notify_ev_t;
typedef struct {
- /*
- * This is a hack to allow a non-leader to accept requests while the
- * leader is down, and it only works for n=2. The way it works is that
- * "config_leader" indicates the state from our options (via init or
- * reconfigure) but "leader" is what the fop code actually looks at. If
- * config_leader is true, then leader will *always* be true as well,
- * giving that brick precedence. If config_leader is false, then
- * leader will only be true if there is no connection to the other
- * brick (tracked in jbr_notify).
- *
- * TBD: implement real leader election
- */
- gf_boolean_t config_leader;
- gf_boolean_t leader;
- uint8_t up_children;
- uint8_t n_children;
- char *vol_file;
- uint32_t current_term;
- uint32_t kid_state;
- gf_lock_t dirty_lock;
- struct list_head dirty_fds;
- uint32_t index;
- gf_lock_t index_lock;
- double quorum_pct;
- int term_fd;
- long term_total;
- long term_read;
- /*
- * This is a super-duper hack, but it will do for now. The reason it's
- * a hack is that we pass this to dict_set_static_bin, so we don't have
- * to mess around with allocating and freeing it on every single IPC
- * request, but it's totally not thread-safe. On the other hand, there
- * should only be one reconciliation thread running and calling these
- * functions at a time, so maybe that doesn't matter.
- *
- * TBD: re-evaluate how to manage this
- */
- char term_buf[CHANGELOG_ENTRY_SIZE];
- gf_boolean_t child_up; /* To maintain the state of *
- * the translator */
+ /*
+ * This is a hack to allow a non-leader to accept requests while the
+ * leader is down, and it only works for n=2. The way it works is that
+ * "config_leader" indicates the state from our options (via init or
+ * reconfigure) but "leader" is what the fop code actually looks at. If
+ * config_leader is true, then leader will *always* be true as well,
+ * giving that brick precedence. If config_leader is false, then
+ * leader will only be true if there is no connection to the other
+ * brick (tracked in jbr_notify).
+ *
+ * TBD: implement real leader election
+ */
+ gf_boolean_t config_leader;
+ gf_boolean_t leader;
+ uint8_t up_children;
+ uint8_t n_children;
+ char *vol_file;
+ uint32_t current_term;
+ uint32_t kid_state;
+ gf_lock_t dirty_lock;
+ struct list_head dirty_fds;
+ uint32_t index;
+ gf_lock_t index_lock;
+ double quorum_pct;
+ int term_fd;
+ long term_total;
+ long term_read;
+ /*
+ * This is a super-duper hack, but it will do for now. The reason it's
+ * a hack is that we pass this to dict_set_static_bin, so we don't have
+ * to mess around with allocating and freeing it on every single IPC
+ * request, but it's totally not thread-safe. On the other hand, there
+ * should only be one reconciliation thread running and calling these
+ * functions at a time, so maybe that doesn't matter.
+ *
+ * TBD: re-evaluate how to manage this
+ */
+ char term_buf[CHANGELOG_ENTRY_SIZE];
+ gf_boolean_t child_up; /* To maintain the state of *
+ * the translator */
} jbr_private_t;
typedef struct {
- call_stub_t *stub;
- call_stub_t *qstub;
- uint32_t call_count;
- uint32_t successful_acks;
- uint32_t successful_op_ret;
- fd_t *fd;
- struct list_head qlinks;
- dict_t *xdata;
+ call_stub_t *stub;
+ call_stub_t *qstub;
+ uint32_t call_count;
+ uint32_t successful_acks;
+ uint32_t successful_op_ret;
+ fd_t *fd;
+ struct list_head qlinks;
+ dict_t *xdata;
} jbr_local_t;
/*
@@ -96,22 +96,23 @@ typedef struct {
typedef uint32_t log_id_t;
typedef struct {
- struct list_head links;
- log_id_t id;
+ struct list_head links;
+ log_id_t id;
} jbr_dirty_list_t;
typedef struct {
- fd_t *fd;
- struct list_head dirty_list;
- struct list_head fd_list;
+ fd_t *fd;
+ struct list_head dirty_list;
+ struct list_head fd_list;
} jbr_fd_ctx_t;
typedef struct {
- gf_lock_t lock;
- uint32_t active;
- struct list_head aqueue;
- uint32_t pending;
- struct list_head pqueue;
+ gf_lock_t lock;
+ uint32_t active;
+ struct list_head aqueue;
+ uint32_t pending;
+ struct list_head pqueue;
} jbr_inode_ctx_t;
-void jbr_start_reconciler (xlator_t *this);
+void
+jbr_start_reconciler(xlator_t *this);