summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c62
1 files changed, 34 insertions, 28 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 70e3536af85..047ff942cec 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -622,7 +622,7 @@ glusterd_store_remove_bricks (glusterd_volinfo_t *volinfo, char *delete_path)
GF_ASSERT (volinfo);
- list_for_each_entry (tmp, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (tmp, &volinfo->bricks, brick_list) {
ret = glusterd_store_delete_brick (tmp, delete_path);
if (ret)
goto out;
@@ -1238,7 +1238,7 @@ glusterd_store_brickinfos (glusterd_volinfo_t *volinfo, int vol_fd)
GF_ASSERT (volinfo);
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
ret = glusterd_store_brickinfo (volinfo, brickinfo,
brick_count, vol_fd);
if (ret)
@@ -1476,7 +1476,7 @@ glusterd_store_bricks_cleanup_tmp (glusterd_volinfo_t *volinfo)
GF_ASSERT (volinfo);
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
gf_store_unlink_tmppath (brickinfo->shandle);
}
}
@@ -1505,7 +1505,7 @@ glusterd_store_brickinfos_atomic_update (glusterd_volinfo_t *volinfo)
GF_ASSERT (volinfo);
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
ret = gf_store_rename_tmppath (brickinfo->shandle);
if (ret)
goto out;
@@ -2373,7 +2373,7 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo)
brickid++);
}
- list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
+ cds_list_add_tail (&brickinfo->brick_list, &volinfo->bricks);
brick_count++;
}
@@ -2901,8 +2901,9 @@ glusterd_store_retrieve_volume (char *volname, glusterd_snap_t *snap)
if (!snap) {
- list_add_order (&volinfo->vol_list, &priv->volumes,
- glusterd_compare_volume_name);
+ glusterd_list_add_order (&volinfo->vol_list, &priv->volumes,
+ glusterd_compare_volume_name);
+
} else {
ret = glusterd_volinfo_find (volinfo->parent_volname,
&origin_volinfo);
@@ -3231,7 +3232,7 @@ glusterd_recreate_vol_brick_mounts (xlator_t *this,
GF_ASSERT (volinfo);
brick_count = 0;
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
brick_count++;
/* If the brick is not of this node, or its
* snapshot is pending, or the brick is not
@@ -3309,8 +3310,9 @@ glusterd_resolve_snap_bricks (xlator_t *this, glusterd_snap_t *snap)
GF_ASSERT (this);
GF_VALIDATE_OR_GOTO (this->name, snap, out);
- list_for_each_entry (volinfo, &snap->volumes, vol_list) {
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (volinfo, &snap->volumes, vol_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks,
+ brick_list) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,
@@ -3453,8 +3455,8 @@ glusterd_store_retrieve_snap (char *snapname)
/* TODO: list_add_order can do 'N-square' comparisions and
is not efficient. Find a better solution to store the snap
in order */
- list_add_order (&snap->snap_list, &priv->snapshots,
- glusterd_compare_snap_time);
+ glusterd_list_add_order (&snap->snap_list, &priv->snapshots,
+ glusterd_compare_snap_time);
out:
gf_log (this->name, GF_LOG_TRACE, "Returning with %d", ret);
@@ -3635,11 +3637,11 @@ glusterd_store_write_missed_snapinfo (int32_t fd)
GF_ASSERT (priv);
/* Write the missed_snap_entry */
- list_for_each_entry (missed_snapinfo, &priv->missed_snaps_list,
- missed_snaps) {
- list_for_each_entry (snap_opinfo,
- &missed_snapinfo->snap_ops,
- snap_ops_list) {
+ cds_list_for_each_entry (missed_snapinfo, &priv->missed_snaps_list,
+ missed_snaps) {
+ cds_list_for_each_entry (snap_opinfo,
+ &missed_snapinfo->snap_ops,
+ snap_ops_list) {
snprintf (key, sizeof(key), "%s:%s",
missed_snapinfo->node_uuid,
missed_snapinfo->snap_uuid);
@@ -3911,7 +3913,8 @@ glusterd_store_peer_write (int fd, glusterd_peerinfo_t *peerinfo)
if (ret)
goto out;
- list_for_each_entry (hostname, &peerinfo->hostnames, hostname_list) {
+ cds_list_for_each_entry (hostname, &peerinfo->hostnames,
+ hostname_list) {
ret = gf_asprintf (&key, GLUSTERD_STORE_KEY_PEER_HOSTNAME"%d",
i);
if (ret < 0)
@@ -4074,8 +4077,9 @@ glusterd_store_retrieve_peers (xlator_t *this)
/* Set first hostname from peerinfo->hostnames to
* peerinfo->hostname
*/
- address = list_entry (peerinfo->hostnames.next,
- glusterd_peer_hostname_t, hostname_list);
+ address = cds_list_entry (peerinfo->hostnames.next,
+ glusterd_peer_hostname_t,
+ hostname_list);
if (!address) {
ret = -1;
goto out;
@@ -4092,7 +4096,7 @@ glusterd_store_retrieve_peers (xlator_t *this)
}
args.mode = GD_MODE_ON;
- list_for_each_entry (peerinfo, &priv->peers, uuid_list) {
+ cds_list_for_each_entry (peerinfo, &priv->peers, uuid_list) {
ret = glusterd_friend_rpc_create (this, peerinfo, &args);
if (ret)
goto out;
@@ -4128,7 +4132,7 @@ glusterd_recreate_all_snap_brick_mounts (xlator_t *this)
GF_ASSERT (priv);
/* Recreate bricks of volumes restored from snaps */
- list_for_each_entry (volinfo, &priv->volumes, vol_list) {
+ cds_list_for_each_entry (volinfo, &priv->volumes, vol_list) {
/* If the volume is not a restored volume then continue */
if (uuid_is_null (volinfo->restored_from_snap))
continue;
@@ -4143,8 +4147,8 @@ glusterd_recreate_all_snap_brick_mounts (xlator_t *this)
}
/* Recreate bricks of snapshot volumes */
- list_for_each_entry (snap, &priv->snapshots, snap_list) {
- list_for_each_entry (volinfo, &snap->volumes, vol_list) {
+ cds_list_for_each_entry (snap, &priv->snapshots, snap_list) {
+ cds_list_for_each_entry (volinfo, &snap->volumes, vol_list) {
ret = glusterd_recreate_vol_brick_mounts (this,
volinfo);
if (ret) {
@@ -4195,7 +4199,8 @@ glusterd_snap_cleanup (xlator_t *this)
goto out;
}
- list_for_each_entry_safe (snap, tmp_snap, &priv->snapshots, snap_list) {
+ cds_list_for_each_entry_safe (snap, tmp_snap, &priv->snapshots,
+ snap_list) {
if (snap->snap_status == GD_SNAP_STATUS_RESTORED) {
ret = glusterd_snapshot_revert_restore_from_snap (snap);
if (ret) {
@@ -4238,8 +4243,9 @@ glusterd_resolve_all_bricks (xlator_t *this)
GF_ASSERT (priv);
/* Resolve bricks of volumes */
- list_for_each_entry (volinfo, &priv->volumes, vol_list) {
- list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
+ cds_list_for_each_entry (volinfo, &priv->volumes, vol_list) {
+ cds_list_for_each_entry (brickinfo, &volinfo->bricks,
+ brick_list) {
ret = glusterd_resolve_brick (brickinfo);
if (ret) {
gf_log ("glusterd", GF_LOG_ERROR,
@@ -4250,7 +4256,7 @@ glusterd_resolve_all_bricks (xlator_t *this)
}
/* Resolve bricks of snapshot volumes */
- list_for_each_entry (snap, &priv->snapshots, snap_list) {
+ cds_list_for_each_entry (snap, &priv->snapshots, snap_list) {
ret = glusterd_resolve_snap_bricks (this, snap);
if (ret) {
gf_log (this->name, GF_LOG_ERROR,