[sheepdog] [PATCH v1 2/3] sheep: don't calculate vnode info for pure gateway
Robin Dong
robin.k.dong at gmail.com
Wed Jun 18 10:48:57 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 db9fb76..3c493e8 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 vnode 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