[Sheepdog] [PATCH] remove unused status definition
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Mon May 10 12:48:37 CEST 2010
Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
collie/collie_priv.h | 3 +--
collie/group.c | 9 ++-------
collie/net.c | 7 ++-----
include/collie.h | 3 +--
shepherd/shepherd.c | 10 +++-------
5 files changed, 9 insertions(+), 23 deletions(-)
diff --git a/collie/collie_priv.h b/collie/collie_priv.h
index 35f0a54..43cde33 100644
--- a/collie/collie_priv.h
+++ b/collie/collie_priv.h
@@ -36,8 +36,7 @@
#define SD_STATUS_WAIT_FOR_FORMAT 0x01
#define SD_STATUS_WAIT_FOR_JOIN 0x02
#define SD_STATUS_SHUTDOWN 0x03
-#define SD_STATUS_INCONSISTENT_EPOCHS 0x04
-#define SD_STATUS_JOIN_FAILED 0x05
+#define SD_STATUS_JOIN_FAILED 0x04
enum cpg_event_type {
CPG_EVENT_CONCHG,
diff --git a/collie/group.c b/collie/group.c
index 91b0f4e..afe7a85 100644
--- a/collie/group.c
+++ b/collie/group.c
@@ -289,9 +289,6 @@ void cluster_queue_request(struct work *work, int idx)
case SD_STATUS_SHUTDOWN:
ret = SD_RES_SHUTDOWN;
break;
- case SD_STATUS_INCONSISTENT_EPOCHS:
- ret = SD_RES_INCONSISTENT_EPOCHS;
- break;
case SD_STATUS_JOIN_FAILED:
ret = SD_RES_JOIN_FAILED;
break;
@@ -462,8 +459,6 @@ static int get_cluster_status(struct sheepdog_node_list_entry *from,
break;
case SD_STATUS_SHUTDOWN:
return SD_RES_SHUTDOWN;
- case SD_STATUS_INCONSISTENT_EPOCHS:
- return SD_RES_INCONSISTENT_EPOCHS;
default:
break;
}
@@ -662,7 +657,7 @@ out:
sys->epoch = get_latest_epoch();
}
- if (sys->status != SD_STATUS_INCONSISTENT_EPOCHS || sys->status != SD_STATUS_JOIN_FAILED) {
+ if (sys->status != SD_STATUS_JOIN_FAILED) {
if (msg->cluster_status == SD_STATUS_OK) {
get_vdi_bitmap_from_all();
set_global_nr_copies(sys->nr_sobjs);
@@ -1546,7 +1541,7 @@ static void sd_confchg(cpg_handle_t handle, const struct cpg_name *group_name,
member_list[i].reason);
}
- if (sys->status == SD_STATUS_SHUTDOWN || sys->status == SD_STATUS_INCONSISTENT_EPOCHS)
+ if (sys->status == SD_STATUS_SHUTDOWN)
return;
w = zalloc(sizeof(*w));
diff --git a/collie/net.c b/collie/net.c
index 87c27da..5ee0107 100644
--- a/collie/net.c
+++ b/collie/net.c
@@ -162,8 +162,7 @@ static void queue_request(struct request *req)
}
if (sys->status == SD_STATUS_WAIT_FOR_FORMAT ||
- sys->status == SD_STATUS_WAIT_FOR_JOIN ||
- sys->status == SD_STATUS_INCONSISTENT_EPOCHS) {
+ sys->status == SD_STATUS_WAIT_FOR_JOIN) {
/* TODO: cleanup */
switch (hdr->opcode) {
case SD_OP_STAT_CLUSTER:
@@ -174,10 +173,8 @@ static void queue_request(struct request *req)
default:
if (sys->status == SD_STATUS_WAIT_FOR_FORMAT)
rsp->result = SD_RES_WAIT_FOR_FORMAT;
- else if (sys->status == SD_STATUS_WAIT_FOR_JOIN)
- rsp->result = SD_RES_WAIT_FOR_JOIN;
else
- rsp->result = SD_RES_INCONSISTENT_EPOCHS;
+ rsp->result = SD_RES_WAIT_FOR_JOIN;
req->done(req);
return;
}
diff --git a/include/collie.h b/include/collie.h
index e4019d2..ecbb72f 100644
--- a/include/collie.h
+++ b/include/collie.h
@@ -40,8 +40,7 @@
#define SD_RES_NOT_FORMATTED 0x45 /* Sheepdog is not formatted yet */
#define SD_RES_INVALID_CTIME 0x46 /* Creation time of sheepdog is different */
#define SD_RES_INVALID_EPOCH 0x47 /* Invalid epoch */
-#define SD_RES_INCONSISTENT_EPOCHS 0x48 /* There is inconsistency between epochs */
-#define SD_RES_JOIN_FAILED 0x49 /* Target node was failed to join sheepdog */
+#define SD_RES_JOIN_FAILED 0x48 /* Target node was failed to join sheepdog */
struct sd_so_req {
uint8_t proto_ver;
diff --git a/shepherd/shepherd.c b/shepherd/shepherd.c
index 8614f84..8a0e421 100644
--- a/shepherd/shepherd.c
+++ b/shepherd/shepherd.c
@@ -145,10 +145,6 @@ static int update_node_list(int max_nodes, int epoch)
fprintf(stderr, "sheepdog is shutting down\n");
ret = -1;
goto out;
- case SD_RES_INCONSISTENT_EPOCHS:
- fprintf(stderr, "there is inconsistency betweeen epochs\n");
- ret = -1;
- goto out;
default:
fprintf(stderr, "unknown error: %d\n", rsp->result);
ret = -1;
@@ -985,12 +981,12 @@ static int cluster_info(int argc, char **argv)
case SD_RES_WAIT_FOR_JOIN:
printf("sheepdog is waiting for other nodes joining\n");
break;
- case SD_RES_INCONSISTENT_EPOCHS:
- printf("there is inconsistency between epochs\n");
- break;
case SD_RES_SHUTDOWN:
printf("shutdown\n");
break;
+ case SD_RES_JOIN_FAILED:
+ printf("failed to join sheepdog\n");
+ break;
default:
printf("%d\n", rsp->rsvd);
break;
--
1.5.6.5
More information about the sheepdog
mailing list