diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-syncop.c | 53 |
1 files changed, 28 insertions, 25 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c index f37aa483a00..15b713d2296 100644 --- a/xlators/mgmt/glusterd/src/glusterd-syncop.c +++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c @@ -1067,8 +1067,8 @@ out: int -gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers, - glusterd_op_t op) +gd_build_peers_list (struct cds_list_head *peers, + struct cds_list_head *xact_peers, glusterd_op_t op) { glusterd_peerinfo_t *peerinfo = NULL; int npeers = 0; @@ -1076,22 +1076,22 @@ gd_build_peers_list (struct list_head *peers, struct list_head *xact_peers, GF_ASSERT (peers); GF_ASSERT (xact_peers); - list_for_each_entry (peerinfo, peers, uuid_list) { + cds_list_for_each_entry (peerinfo, peers, uuid_list) { if (!peerinfo->connected) continue; if (op != GD_OP_SYNC_VOLUME && peerinfo->state.state != GD_FRIEND_STATE_BEFRIENDED) continue; - list_add_tail (&peerinfo->op_peers_list, xact_peers); + cds_list_add_tail (&peerinfo->op_peers_list, xact_peers); npeers++; } return npeers; } int -gd_build_local_xaction_peers_list (struct list_head *peers, - struct list_head *xact_peers, +gd_build_local_xaction_peers_list (struct cds_list_head *peers, + struct cds_list_head *xact_peers, glusterd_op_t op) { glusterd_peerinfo_t *peerinfo = NULL; @@ -1101,7 +1101,7 @@ gd_build_local_xaction_peers_list (struct list_head *peers, GF_ASSERT (peers); GF_ASSERT (xact_peers); - list_for_each_entry (peerinfo, peers, uuid_list) { + cds_list_for_each_entry (peerinfo, peers, uuid_list) { if (!peerinfo->connected) continue; if (op != GD_OP_SYNC_VOLUME && @@ -1113,26 +1113,27 @@ gd_build_local_xaction_peers_list (struct list_head *peers, if (!local_peers) { return -1; } - INIT_LIST_HEAD (&local_peers->op_peers_list); + CDS_INIT_LIST_HEAD (&local_peers->op_peers_list); local_peers->peerinfo = peerinfo; - list_add_tail (&local_peers->op_peers_list, xact_peers); + cds_list_add_tail (&local_peers->op_peers_list, xact_peers); npeers++; } return npeers; } void -gd_cleanup_local_xaction_peers_list (struct list_head *xact_peers) +gd_cleanup_local_xaction_peers_list (struct cds_list_head *xact_peers) { glusterd_local_peers_t *local_peers = NULL; glusterd_local_peers_t *tmp = NULL; GF_ASSERT (xact_peers); - if (list_empty (xact_peers)) + if (cds_list_empty (xact_peers)) return; - list_for_each_entry_safe (local_peers, tmp, xact_peers, op_peers_list) { + cds_list_for_each_entry_safe (local_peers, tmp, xact_peers, + op_peers_list) { GF_FREE (local_peers); /* local_peers->peerinfo need not be freed because it does not * ownership of peerinfo, but merely refer it */ @@ -1142,7 +1143,7 @@ gd_cleanup_local_xaction_peers_list (struct list_head *xact_peers) int gd_lock_op_phase (glusterd_conf_t *conf, glusterd_op_t op, dict_t *op_ctx, char **op_errstr, int npeers, uuid_t txn_id, - struct list_head *peers) + struct cds_list_head *peers) { int ret = -1; int peer_cnt = 0; @@ -1197,8 +1198,9 @@ out: } int -gd_stage_op_phase (struct list_head *peers, glusterd_op_t op, dict_t *op_ctx, - dict_t *req_dict, char **op_errstr, int npeers) +gd_stage_op_phase (struct cds_list_head *peers, glusterd_op_t op, + dict_t *op_ctx, dict_t *req_dict, char **op_errstr, + int npeers) { int ret = -1; int peer_cnt = 0; @@ -1304,8 +1306,9 @@ out: } int -gd_commit_op_phase (struct list_head *peers, glusterd_op_t op, dict_t *op_ctx, - dict_t *req_dict, char **op_errstr, int npeers) +gd_commit_op_phase (struct cds_list_head *peers, glusterd_op_t op, + dict_t *op_ctx, dict_t *req_dict, char **op_errstr, + int npeers) { dict_t *rsp_dict = NULL; int peer_cnt = -1; @@ -1407,7 +1410,7 @@ int gd_unlock_op_phase (glusterd_conf_t *conf, glusterd_op_t op, int *op_ret, rpcsvc_request_t *req, dict_t *op_ctx, char *op_errstr, int npeers, char *volname, gf_boolean_t is_acquired, - uuid_t txn_id, struct list_head *peers) + uuid_t txn_id, struct cds_list_head *peers) { glusterd_peerinfo_t *peerinfo = NULL; uuid_t tmp_uuid = {0}; @@ -1505,11 +1508,11 @@ out: } int -gd_get_brick_count (struct list_head *bricks) +gd_get_brick_count (struct cds_list_head *bricks) { glusterd_pending_node_t *pending_node = NULL; int npeers = 0; - list_for_each_entry (pending_node, bricks, list) { + cds_list_for_each_entry (pending_node, bricks, list) { npeers++; } return npeers; @@ -1520,7 +1523,7 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, char **op_errstr) { glusterd_pending_node_t *pending_node = NULL; - struct list_head selected = {0,}; + struct cds_list_head selected = {0,}; xlator_t *this = NULL; int brick_count = 0; int ret = -1; @@ -1536,7 +1539,7 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, goto out; } - INIT_LIST_HEAD (&selected); + CDS_INIT_LIST_HEAD (&selected); ret = glusterd_op_bricks_select (op, req_dict, op_errstr, &selected, rsp_dict); if (ret) { @@ -1555,7 +1558,7 @@ gd_brick_op_phase (glusterd_op_t op, dict_t *op_ctx, dict_t *req_dict, rsp_dict = NULL; brick_count = 0; - list_for_each_entry (pending_node, &selected, list) { + cds_list_for_each_entry (pending_node, &selected, list) { rpc = glusterd_pending_node_get_rpc (pending_node); if (!rpc) { if (pending_node->type == GD_NODE_REBALANCE) { @@ -1603,7 +1606,7 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req) xlator_t *this = NULL; gf_boolean_t is_acquired = _gf_false; uuid_t *txn_id = NULL; - struct list_head xaction_peers = {0,}; + struct cds_list_head xaction_peers = {0,}; glusterd_op_info_t txn_opinfo; this = THIS; @@ -1611,7 +1614,7 @@ gd_sync_task_begin (dict_t *op_ctx, rpcsvc_request_t * req) conf = this->private; GF_ASSERT (conf); - INIT_LIST_HEAD (&xaction_peers); + CDS_INIT_LIST_HEAD (&xaction_peers); ret = dict_get_int32 (op_ctx, GD_SYNC_OPCODE_KEY, &tmp_op); if (ret) { |