[sheepdog] [PATCH 3/5] use tabs for code indent
MORITA Kazutaka
morita.kazutaka at gmail.com
Fri Feb 22 01:38:40 CET 2013
From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
collie/cluster.c | 25 ++++++++++++-------------
collie/collie.c | 4 ++--
include/list.h | 30 ++++++++++++++----------------
lib/sha1.c | 2 +-
sheep/cluster.h | 3 ++-
sheep/cluster/corosync.c | 6 +++---
6 files changed, 34 insertions(+), 36 deletions(-)
diff --git a/collie/cluster.c b/collie/cluster.c
index 86da2ed..505f65e 100644
--- a/collie/cluster.c
+++ b/collie/cluster.c
@@ -73,13 +73,12 @@ static int list_store(void)
return EXIT_SYSFAIL;
}
-#define FORMAT_PRINT \
-"\
- __ \n\
- ()'`; \n\
- /\\|` \n\
- / | Caution! The cluster is not empty.\n\
-(/_)_|_ Are you sure you want to continue? [yes/no]: "
+#define FORMAT_PRINT \
+ " __\n" \
+ " ()'`;\n" \
+ " /\\|`\n" \
+ " / | Caution! The cluster is not empty.\n" \
+ "(/_)_|_ Are you sure you want to continue? [yes/no]: "
static int cluster_format(int argc, char **argv)
{
@@ -359,12 +358,12 @@ static int cluster_snapshot(int argc, char **argv)
}
#define RECOVER_PRINT \
-"Caution! Please try starting all the cluster nodes normally before\n\
-running this command.\n\n\
-The cluster may need to be force recovered if:\n\
- - the master node fails to start because of epoch mismatch; or\n\
- - some nodes fail to start after a cluster shutdown.\n\n\
-Are you sure you want to continue? [yes/no]: "
+ "Caution! Please try starting all the cluster nodes normally before\n" \
+ "running this command.\n\n" \
+ "The cluster may need to be force recovered if:\n" \
+ " - the master node fails to start because of epoch mismatch; or\n" \
+ " - some nodes fail to start after a cluster shutdown.\n\n" \
+ "Are you sure you want to continue? [yes/no]: "
static int cluster_force_recover(int argc, char **argv)
{
diff --git a/collie/collie.c b/collie/collie.c
index 15e24e6..bac595b 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -29,8 +29,8 @@ static const struct sd_option collie_options[] = {
/* common options for all collie commands */
{'a', "address", true, "specify the daemon address (default: localhost)"},
{'p', "port", true, "specify the daemon port"},
- {'r', "raw", false, "raw output mode: omit headers, separate fields with\n\
- single spaces and print all sizes in decimal bytes"},
+ {'r', "raw", false, "raw output mode: omit headers, separate fields with\n"
+ " single spaces and print all sizes in decimal bytes"},
{'h', "help", false, "display this help and exit"},
{ 0, NULL, false, NULL },
diff --git a/include/list.h b/include/list.h
index 723e1bd..2823075 100644
--- a/include/list.h
+++ b/include/list.h
@@ -40,13 +40,13 @@ static inline int list_empty(const struct list_head *head)
#define list_for_each_entry(pos, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member); \
- &pos->member != (head); \
+ &pos->member != (head); \
pos = list_entry(pos->member.next, typeof(*pos), member))
#define list_for_each_entry_safe(pos, n, head, member) \
for (pos = list_entry((head)->next, typeof(*pos), member), \
n = list_entry(pos->member.next, typeof(*pos), member); \
- &pos->member != (head); \
+ &pos->member != (head); \
pos = n, n = list_entry(n->member.next, typeof(*n), member))
static inline void __list_add(struct list_head *new,
@@ -220,11 +220,11 @@ static inline void hlist_add_after(struct hlist_node *n,
#define hlist_entry(ptr, type, member) container_of(ptr, type, member)
#define hlist_for_each(pos, head) \
- for (pos = (head)->first; pos ; pos = pos->next)
+ for (pos = (head)->first; pos ; pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
- for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
- pos = n)
+ for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
+ pos = n)
/**
* hlist_for_each_entry - iterate over list of given type
@@ -233,11 +233,10 @@ static inline void hlist_add_after(struct hlist_node *n,
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
-#define hlist_for_each_entry(tpos, pos, head, member) \
- for (pos = (head)->first; \
- pos && \
- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
- pos = pos->next)
+#define hlist_for_each_entry(tpos, pos, head, member) \
+ for (pos = (head)->first; \
+ pos && ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
+ pos = pos->next)
/**
* hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
@@ -247,12 +246,11 @@ static inline void hlist_add_after(struct hlist_node *n,
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
-#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
- for (pos = (head)->first; \
- pos && ({ n = pos->next; 1; }) && \
- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
- pos = n)
-
+#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
+ for (pos = (head)->first; \
+ pos && ({ n = pos->next; 1; }) && \
+ ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \
+ pos = n)
#endif
diff --git a/lib/sha1.c b/lib/sha1.c
index ac8a73a..8d3399a 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -61,7 +61,7 @@ static void sha1_transform(uint32_t *state, const uint8_t *in)
/* convert/copy data to workspace */
for (a = 0; a < sizeof(block32)/sizeof(uint32_t); a++)
- block32[a] = ntohl(((const uint32_t *)in)[a]);
+ block32[a] = ntohl(((const uint32_t *)in)[a]);
/* Copy context->state[] to working vars */
a = state[0];
diff --git a/sheep/cluster.h b/sheep/cluster.h
index b876db5..2ef8f26 100644
--- a/sheep/cluster.h
+++ b/sheep/cluster.h
@@ -118,7 +118,8 @@ struct cluster_driver {
extern struct list_head cluster_drivers;
#define cdrv_register(driver) \
-static void __attribute__((constructor)) regist_ ## driver(void) { \
+static void __attribute__((constructor)) regist_ ## driver(void) \
+{ \
if (!driver.init || !driver.join || !driver.leave || !driver.notify) \
panic("the driver '%s' is incomplete\n", driver.name); \
list_add(&driver.list, &cluster_drivers); \
diff --git a/sheep/cluster/corosync.c b/sheep/cluster/corosync.c
index e732e99..fb43a8b 100644
--- a/sheep/cluster/corosync.c
+++ b/sheep/cluster/corosync.c
@@ -624,9 +624,9 @@ static void cdrv_cpg_confchg(cpg_handle_t handle,
cevent = xzalloc(sizeof(*cevent));
master = is_master(&left_sheep[i]);
if (master >= 0)
- /* Master is down before new nodes finish joining.
- * We have to revoke its mastership to avoid cluster hanging
- */
+ /* Master is down before new nodes finish joining.
+ * We have to revoke its mastership to avoid cluster
+ * hanging */
cpg_nodes[master].gone = 1;
cevent->type = COROSYNC_EVENT_TYPE_LEAVE;
--
1.7.9.5
More information about the sheepdog
mailing list