[sheepdog] [PATCH 1/2] sheep: set LOCK_VDI/GET_VDI_INFO/RELEASE_VDI as local type

Liu Yuan namei.unix at gmail.com
Tue Jan 29 06:22:05 CET 2013


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

There is no need to broadcast these operations for now. Set them as local type
will reduce the network traffic.

Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/ops.c |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/sheep/ops.c b/sheep/ops.c
index 43aaa2f..c7370cd 100644
--- a/sheep/ops.c
+++ b/sheep/ops.c
@@ -200,7 +200,7 @@ static int post_cluster_del_vdi(const struct sd_req *req, struct sd_rsp *rsp,
 	return ret;
 }
 
-static int cluster_get_vdi_info(struct request *req)
+static int local_get_vdi_info(struct request *req)
 {
 	const struct sd_req *hdr = &req->rq;
 	struct sd_rsp *rsp = &req->rp;
@@ -906,18 +906,6 @@ static struct sd_op_template sd_ops[] = {
 		.process_main = post_cluster_del_vdi,
 	},
 
-	[SD_OP_GET_VDI_INFO] = {
-		.name = "GET_VDI_INFO",
-		.type = SD_OP_TYPE_CLUSTER,
-		.process_work = cluster_get_vdi_info,
-	},
-
-	[SD_OP_LOCK_VDI] = {
-		.name = "LOCK_VDI",
-		.type = SD_OP_TYPE_CLUSTER,
-		.process_work = cluster_get_vdi_info,
-	},
-
 	[SD_OP_MAKE_FS] = {
 		.name = "MAKE_FS",
 		.type = SD_OP_TYPE_CLUSTER,
@@ -937,11 +925,6 @@ static struct sd_op_template sd_ops[] = {
 		.process_work = cluster_get_vdi_attr,
 	},
 
-	[SD_OP_RELEASE_VDI] = {
-		.name = "RELEASE_VDI",
-		.type = SD_OP_TYPE_CLUSTER,
-	},
-
 	[SD_OP_FORCE_RECOVER] = {
 		.name = "FORCE_RECOVER",
 		.type = SD_OP_TYPE_CLUSTER,
@@ -998,6 +981,23 @@ static struct sd_op_template sd_ops[] = {
 	},
 
 	/* local operations */
+	[SD_OP_GET_VDI_INFO] = {
+		.name = "GET_VDI_INFO",
+		.type = SD_OP_TYPE_LOCAL,
+		.process_work = local_get_vdi_info,
+	},
+
+	[SD_OP_LOCK_VDI] = {
+		.name = "LOCK_VDI",
+		.type = SD_OP_TYPE_LOCAL,
+		.process_work = local_get_vdi_info,
+	},
+
+	[SD_OP_RELEASE_VDI] = {
+		.name = "RELEASE_VDI",
+		.type = SD_OP_TYPE_LOCAL,
+	},
+
 	[SD_OP_GET_STORE_LIST] = {
 		.name = "GET_STORE_LIST",
 		.type = SD_OP_TYPE_LOCAL,
-- 
1.7.9.5




More information about the sheepdog mailing list