[Sheepdog] [PATCH v2 2/3] sheep: export update_epoch_log()

Liu Yuan namei.unix at gmail.com
Mon Oct 24 11:19:16 CEST 2011


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


Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/group.c      |   13 -------------
 sheep/sheep_priv.h |    1 +
 sheep/store.c      |   14 ++++++++++++++
 3 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/sheep/group.c b/sheep/group.c
index 9851ea8..7d5064b 100644
--- a/sheep/group.c
+++ b/sheep/group.c
@@ -441,19 +441,6 @@ static void get_vdi_bitmap_from_sd_list(void)
 		get_vdi_bitmap_from(sys->nodes + i);
 }
 
-static int update_epoch_log(int epoch)
-{
-	int ret;
-
-	dprintf("update epoch, %d, %d\n", epoch, sys->nr_nodes);
-	ret = epoch_log_write(epoch, (char *)sys->nodes,
-			      sys->nr_nodes * sizeof(struct sheepdog_node_list_entry));
-	if (ret < 0)
-		eprintf("can't write epoch %u\n", epoch);
-
-	return ret;
-}
-
 static void update_cluster_info(struct join_message *msg,
 				struct sheepdog_node_list_entry *joined,
 				struct sheepdog_node_list_entry *nodes,
diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h
index 36d94d6..418b69f 100644
--- a/sheep/sheep_priv.h
+++ b/sheep/sheep_priv.h
@@ -199,6 +199,7 @@ int read_epoch(uint32_t *epoch, uint64_t *ctime,
 void cluster_queue_request(struct work *work, int idx);
 
 int update_epoch_store(uint32_t epoch);
+int update_epoch_log(int epoch);
 
 int set_cluster_copies(uint8_t copies);
 int get_cluster_copies(uint8_t *copies);
diff --git a/sheep/store.c b/sheep/store.c
index d2375b8..4e66920 100644
--- a/sheep/store.c
+++ b/sheep/store.c
@@ -472,6 +472,20 @@ int update_epoch_store(uint32_t epoch)
 	return 0;
 }
 
+int update_epoch_log(int epoch)
+{
+        int ret;
+
+        dprintf("update epoch, %d, %d\n", epoch, sys->nr_nodes);
+        ret = epoch_log_write(epoch, (char *)sys->nodes,
+                              sys->nr_nodes * sizeof(struct sheepdog_node_list_entry));
+        if (ret < 0)
+                eprintf("can't write epoch %u\n", epoch);
+
+        return ret;
+}
+
+
 int write_object_local(uint64_t oid, char *data, unsigned int datalen,
 		       uint64_t offset, uint16_t flags, int copies,
 		       uint32_t epoch, int create)
-- 
1.7.6.1




More information about the sheepdog mailing list