[sheepdog] [PATCH v2 7/7] collie: remove copies from 'collie cluster format'
levin li
levin108 at gmail.com
Mon Aug 6 10:40:28 CEST 2012
From: levin li <xingke.lwp at taobao.com>
Signed-off-by: levin li <xingke.lwp at taobao.com>
---
collie/cluster.c | 17 +----------------
1 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/collie/cluster.c b/collie/cluster.c
index 9302b78..f690324 100644
--- a/collie/cluster.c
+++ b/collie/cluster.c
@@ -19,7 +19,6 @@
struct cluster_cmd_data {
uint32_t epoch;
int list;
- int copies;
int nohalt;
int quorum;
int force;
@@ -82,7 +81,6 @@ static int cluster_format(int argc, char **argv)
gettimeofday(&tv, NULL);
sd_init_req((struct sd_req *)&hdr, SD_OP_MAKE_FS);
- hdr.copies = cluster_cmd_data.copies;
if (cluster_cmd_data.nohalt)
hdr.flags |= SD_FLAG_NOHALT;
if (cluster_cmd_data.quorum)
@@ -502,7 +500,7 @@ static int cluster_recover(int argc, char **argv)
static struct subcommand cluster_cmd[] = {
{"info", NULL, "aprh", "show cluster information",
NULL, SUBCMD_FLAG_NEED_NODELIST, cluster_info},
- {"format", NULL, "bcmaph", "create a Sheepdog store",
+ {"format", NULL, "bmaph", "create a Sheepdog store",
NULL, 0, cluster_format},
{"shutdown", NULL, "aph", "stop Sheepdog",
NULL, SUBCMD_FLAG_NEED_NODELIST, cluster_shutdown},
@@ -519,25 +517,12 @@ static struct subcommand cluster_cmd[] = {
static int cluster_parser(int ch, char *opt)
{
- int copies;
char *p;
switch (ch) {
case 'b':
strncpy(cluster_cmd_data.name, opt, 10);
break;
- case 'c':
- copies = strtol(opt, &p, 10);
- if (opt == p || copies < 1) {
- fprintf(stderr, "There must be at least one copy of data\n");
- exit(EXIT_FAILURE);
- } else if (copies > SD_MAX_COPIES) {
- fprintf(stderr, "Redundancy may not exceed %d copies\n",
- SD_MAX_COPIES);
- exit(EXIT_FAILURE);
- }
- cluster_cmd_data.copies = copies;
- break;
case 'm':
if (strcmp(opt, "safe") == 0) {
cluster_cmd_data.nohalt = 0;
--
1.7.1
More information about the sheepdog
mailing list