diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-04-14 08:15:50 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-04-16 14:41:41 +0530 |
commit | f7902b7072015c9c20f47e999af85c923f202d33 (patch) | |
tree | 2e541047e060f9bfe429f8919d9d27adb83a2d87 /xlators/cluster/afr/src/afr-self-heal-entry.c | |
parent | d77279ef04ca75ab9715864274567d1ce0ce66a6 (diff) |
Changed xattr format of afr changelog to support adding and removing of subvolumes while keeping existing data.
Signed-off-by: Anand V. Avati <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-entry.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c index 3906b707e..70edd5bab 100644 --- a/xlators/cluster/afr/src/afr-self-heal-entry.c +++ b/xlators/cluster/afr/src/afr-self-heal-entry.c @@ -217,10 +217,8 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this) sh = &local->self_heal; priv = this->private; - - afr_sh_pending_to_delta (sh->xattr, AFR_ENTRY_PENDING, - sh->delta_matrix, sh->success, - priv->child_count); + afr_sh_pending_to_delta (priv, sh->xattr, sh->delta_matrix, sh->success, + priv->child_count, AFR_ENTRY_TRANSACTION); erase_xattr = CALLOC (sizeof (*erase_xattr), priv->child_count); @@ -233,8 +231,8 @@ afr_sh_entry_erase_pending (call_frame_t *frame, xlator_t *this) } } - afr_sh_delta_to_xattr (sh->delta_matrix, erase_xattr, - priv->child_count, AFR_ENTRY_PENDING); + afr_sh_delta_to_xattr (priv, sh->delta_matrix, erase_xattr, + priv->child_count, AFR_ENTRY_TRANSACTION); local->call_count = call_count; for (i = 0; i < priv->child_count; i++) { @@ -1824,12 +1822,11 @@ afr_sh_entry_fix (call_frame_t *frame, xlator_t *this) sh = &local->self_heal; priv = this->private; - afr_sh_build_pending_matrix (sh->pending_matrix, sh->xattr, - priv->child_count, AFR_ENTRY_PENDING); + afr_sh_build_pending_matrix (priv, sh->pending_matrix, sh->xattr, + priv->child_count, AFR_ENTRY_TRANSACTION); afr_sh_print_pending_matrix (sh->pending_matrix, this); - afr_sh_mark_sources (sh, priv->child_count, AFR_SELF_HEAL_ENTRY); @@ -1902,9 +1899,13 @@ afr_sh_entry_lookup (call_frame_t *frame, xlator_t *this) local->call_count = call_count; xattr_req = dict_new(); - if (xattr_req) - ret = dict_set_uint64 (xattr_req, AFR_ENTRY_PENDING, - priv->child_count * sizeof(int32_t)); + if (xattr_req) { + for (i = 0; i < priv->child_count; i++) { + ret = dict_set_uint64 (xattr_req, + priv->pending_key[i], + 3 * sizeof(int32_t)); + } + } for (i = 0; i < priv->child_count; i++) { if (local->child_up[i]) { |