From: Liu Yuan <tailai.ly at taobao.com> Unify sheepdog_config APIs. Signed-off-by: Liu Yuan <tailai.ly at taobao.com> --- sheep/group.c | 8 ++++---- sheep/sheep_priv.h | 4 ++-- sheep/store.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sheep/group.c b/sheep/group.c index a03f709..6c9858a 100644 --- a/sheep/group.c +++ b/sheep/group.c @@ -854,7 +854,7 @@ join_finished: } /* Fresh node */ if (!sys_stat_ok() && !sys_stat_halt()) { - set_global_nr_copies(sys->nr_sobjs); + set_cluster_copies(sys->nr_sobjs); set_cluster_flags(sys->flags); set_cluster_ctime(msg->ctime); } @@ -983,7 +983,7 @@ static void vdi_op_done(struct vdi_op_message *msg) eprintf("can't write epoch %u\n", sys->epoch); update_epoch_store(sys->epoch); - set_global_nr_copies(sys->nr_sobjs); + set_cluster_copies(sys->nr_sobjs); set_cluster_flags(sys->flags); if (sys_flag_nohalt()) @@ -1378,7 +1378,7 @@ static void send_join_request(struct sheepid *id) msg.header.from = sys->this_node; msg.header.sheepid = sys->this_sheepid; - get_global_nr_copies(&msg.nr_sobjs); + get_cluster_copies(&msg.nr_sobjs); get_cluster_flags(&msg.cluster_flags); nr_entries = ARRAY_SIZE(entries); @@ -1403,7 +1403,7 @@ static void __sd_join_done(struct cpg_event *cevent) if (w->member_list_entries == 1 && sheepid_cmp(&w->joined, &sys->this_sheepid) == 0) { sys->join_finished = 1; - get_global_nr_copies(&sys->nr_sobjs); + get_cluster_copies(&sys->nr_sobjs); get_cluster_flags(&sys->flags); first_cpg_node = 1; } diff --git a/sheep/sheep_priv.h b/sheep/sheep_priv.h index 850dd0d..d976215 100644 --- a/sheep/sheep_priv.h +++ b/sheep/sheep_priv.h @@ -210,8 +210,8 @@ void cluster_queue_request(struct work *work, int idx); int update_epoch_store(uint32_t epoch); -int set_global_nr_copies(uint32_t copies); -int get_global_nr_copies(uint32_t *copies); +int set_cluster_copies(uint32_t copies); +int get_cluster_copies(uint32_t *copies); int set_cluster_flags(uint16_t flags); int get_cluster_flags(uint16_t *flags); diff --git a/sheep/store.c b/sheep/store.c index af8ecd0..a12b977 100644 --- a/sheep/store.c +++ b/sheep/store.c @@ -2027,7 +2027,7 @@ int read_epoch(uint32_t *epoch, uint64_t *ctime, return SD_RES_SUCCESS; } -int set_global_nr_copies(uint32_t copies) +int set_cluster_copies(uint32_t copies) { int fd, ret; @@ -2046,7 +2046,7 @@ int set_global_nr_copies(uint32_t copies) return SD_RES_SUCCESS; } -int get_global_nr_copies(uint32_t *copies) +int get_cluster_copies(uint32_t *copies) { int fd, ret; -- 1.7.6.1 |