[sheepdog] [PATCH] dog: read the latest epoch is enough in cluster_alter_copy

Ruoyu liangry at ucweb.com
Thu Jul 24 05:13:50 CEST 2014


Because the purpose is to get the copy policy and the number of
copies only, reading the latest epoch is nice. No need to read
all epoch records.

Signed-off-by: Ruoyu <liangry at ucweb.com>
---
 dog/cluster.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dog/cluster.c b/dog/cluster.c
index 3d7cd32..ba44ad9 100644
--- a/dog/cluster.c
+++ b/dog/cluster.c
@@ -605,7 +605,7 @@ static int cluster_alter_copy(int argc, char **argv)
 		confirm(info);
 	}
 
-	log_length = sd_epoch * sizeof(struct epoch_log);
+	log_length = sizeof(struct epoch_log);
 	logs = xmalloc(log_length);
 	sd_init_req(&hdr, SD_OP_STAT_CLUSTER);
 	hdr.data_length = log_length;
-- 
1.8.3.2





More information about the sheepdog mailing list