[sheepdog] [PATCH] collie/node: correct md info output

Liu Yuan namei.unix at gmail.com
Fri May 10 04:27:43 CEST 2013


From: Liu Yuan <tailai.ly at taobao.com>

We actually return 'Free' instead of 'Size'

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 collie/node.c |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/collie/node.c b/collie/node.c
index b8999e3..3fe1108 100644
--- a/collie/node.c
+++ b/collie/node.c
@@ -211,7 +211,7 @@ static int node_kill(int argc, char **argv)
 static int node_md_info(struct node_id *nid)
 {
 	struct sd_md_info info = {};
-	char size_str[UINT64_DECIMAL_SIZE], used_str[UINT64_DECIMAL_SIZE];
+	char free_str[UINT64_DECIMAL_SIZE], used_str[UINT64_DECIMAL_SIZE];
 	struct sd_req hdr;
 	struct sd_rsp *rsp = (struct sd_rsp *)&hdr;
 	int ret, i;
@@ -232,10 +232,10 @@ static int node_md_info(struct node_id *nid)
 	}
 
 	for (i = 0; i < info.nr; i++) {
-		size_to_str(info.disk[i].size, size_str, sizeof(size_str));
+		size_to_str(info.disk[i].size, free_str, sizeof(free_str));
 		size_to_str(info.disk[i].used, used_str, sizeof(used_str));
-		fprintf(stdout, "%2d\t%s\t%s\t%s\n", info.disk[i].idx, size_str,
-			used_str, info.disk[i].path);
+		fprintf(stdout, "%2d\t%s\t%s\t%s\n", info.disk[i].idx, used_str,
+			free_str, info.disk[i].path);
 	}
 	return EXIT_SUCCESS;
 }
@@ -244,7 +244,7 @@ static int md_info(int argc, char **argv)
 {
 	int i, ret;
 
-	fprintf(stdout, "Id\tSize\tUse\tPath\n");
+	fprintf(stdout, "Id\tUsed\tFree\tPath\n");
 
 	if (!node_cmd_data.all_nodes) {
 		struct node_id nid = {.port = sdport};
-- 
1.7.9.5




More information about the sheepdog mailing list