[sheepdog] [PATCH 2/2] collie: show 'auto-recovery' status for 'cluster info'

Liu Yuan namei.unix at gmail.com
Mon May 20 17:41:06 CEST 2013


nr_copies is removed because it isn't used at all

Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 collie/cluster.c         |    3 ++-
 include/internal_proto.h |    2 +-
 sheep/ops.c              |    2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/collie/cluster.c b/collie/cluster.c
index dc7ff5a..3ae901b 100644
--- a/collie/cluster.c
+++ b/collie/cluster.c
@@ -155,7 +155,8 @@ static int cluster_info(int argc, char **argv)
 	if (!raw_output)
 		printf("Cluster status: ");
 	if (rsp->result == SD_RES_SUCCESS)
-		printf("running\n");
+		printf("running, auto-recovery %s\n", logs->disable_recovery ?
+		       "disabled" : "enabled");
 	else
 		printf("%s\n", sd_strerror(rsp->result));
 
diff --git a/include/internal_proto.h b/include/internal_proto.h
index a04af88..a5d21f7 100644
--- a/include/internal_proto.h
+++ b/include/internal_proto.h
@@ -130,7 +130,7 @@ struct epoch_log {
 	uint64_t time;		/* treated as time_t */
 	uint32_t epoch;
 	uint32_t nr_nodes;
-	uint32_t nr_copies;
+	uint8_t disable_recovery;
 	struct sd_node nodes[SD_MAX_NODES];
 };
 
diff --git a/sheep/ops.c b/sheep/ops.c
index 6e1caa7..9399fd8 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -452,7 +452,7 @@ static int local_stat_cluster(struct request *req)
 							(time_t *)&log->time,
 							req->vinfo);
 
-		log->nr_copies = sys->nr_copies;
+		log->disable_recovery = sys->disable_recovery;
 
 		rsp->data_length += sizeof(*log);
 		epoch--;
-- 
1.7.9.5




More information about the sheepdog mailing list