[Sheepdog] [PATCH] sheep: gather vdi bitmap in worker thread

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Jun 6 19:28:24 CEST 2011


We cannot wait in main thread, so we must call
get_vdi_bitmap_from_all() in __sd_deliver() instead of
__sd_deliver_done().

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/group.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index cb693ff..67cde1c 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -632,7 +632,6 @@ out:
 			update_epoch_store(sys->epoch);
 		}
 		if (sys->status != SD_STATUS_OK) {
-			get_vdi_bitmap_from_all();
 			set_global_nr_copies(sys->nr_sobjs);
 			set_cluster_ctime(msg->ctime);
 		}
@@ -827,6 +826,17 @@ static void __sd_deliver(struct cpg_event *cevent)
 			break;
 		}
 	}
+
+	if (m->state == DM_FIN) {
+		switch (m->op) {
+		case SD_MSG_JOIN:
+			if (((struct join_message *)m)->cluster_status == SD_STATUS_OK)
+				if (sys->status != SD_STATUS_OK)
+					get_vdi_bitmap_from_all();
+			break;
+		}
+	}
+
 }
 
 static void send_join_response(struct work_deliver *w)
-- 
1.7.2.5




More information about the sheepdog mailing list