[sheepdog] [PATCH v2 3/4] sheep: don't calculate vnode info for pure gateway

Robin Dong robin.k.dong at gmail.com
Fri Jun 20 10:21:29 CEST 2014


From: Robin Dong <sanbai at taobao.com>

In disk mode, we don't need to calculate vnode info when current sheep
is a pure gateway.

Signed-off-by: Robin Dong <sanbai at taobao.com>
---
 sheep/md.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sheep/md.c b/sheep/md.c
index e213ff6..694ec69 100644
--- a/sheep/md.c
+++ b/sheep/md.c
@@ -766,6 +766,10 @@ void update_node_disks(void)
 	if (!sys)
 		return;
 
+	/* Don't need to calculate vnodes for pure gateway */
+	if (sys->this_node.nr_vnodes == 0)
+		return;
+
 	memset(sys->this_node.disks, 0, sizeof(struct disk_info) * DISK_MAX);
 	sd_read_lock(&md.lock);
 	rb_for_each_entry(disk, &md.root, rb) {
-- 
1.7.12.4




More information about the sheepdog mailing list