summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorAnuradha <atalur@redhat.com>2014-09-03 19:04:02 +0530
committerVijay Bellur <vbellur@redhat.com>2014-09-18 11:05:47 -0700
commitacc0b3f93e74e914ee345e9e89619c8411596bdf (patch)
tree14a35cd56cae70fbe433cb5b4e073dce5065d0eb /xlators/cluster/afr/src/afr-self-heal-common.c
parent8f4c223c5f7a7a06c3b73dbb94e85d271bd84fb5 (diff)
cluster/afr : Mark pending changelog xattrs for new creations
Backport of: http://review.gluster.org/8555 Based on type of file, set appropriate pending changelogs for new entries. Change-Id: Icf9af866fe9a9e511210e8ad097e968e2307d8ee BUG: 1141787 Reviewed-on: http://review.gluster.org/8555 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Signed-off-by: Anuradha <atalur@redhat.com> Reviewed-on: http://review.gluster.org/8748 Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 9a88a7d9e5c..ab1552a0224 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -975,6 +975,43 @@ afr_frame_create (xlator_t *this)
return frame;
}
+int
+afr_selfheal_newentry_mark (call_frame_t *frame, xlator_t *this, inode_t *inode,
+ int source, struct afr_reply *replies,
+ unsigned char *sources, unsigned char *newentry)
+{
+ int ret = 0;
+ int i = 0;
+ afr_private_t *priv = NULL;
+ dict_t *xattr = NULL;
+ int **changelog = NULL;
+
+ priv = this->private;
+
+ uuid_copy (inode->gfid, replies[source].poststat.ia_gfid);
+
+ xattr = dict_new();
+ if (!xattr)
+ return -ENOMEM;
+
+ changelog = afr_mark_pending_changelog (priv, newentry, xattr,
+ replies[source].poststat.ia_type);
+
+ if (!changelog)
+ goto out;
+
+ for (i = 0; i < priv->child_count; i++) {
+ if (!sources[i])
+ continue;
+ afr_selfheal_post_op (frame, this, inode, i, xattr);
+ }
+out:
+ if (changelog)
+ afr_matrix_cleanup (changelog, priv->child_count);
+ if (xattr)
+ dict_unref (xattr);
+ return ret;
+}
/*
* This is the entry point for healing a given GFID