diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2011-09-27 14:44:01 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-19 03:17:17 -0700 |
commit | b80a2a150b874031df35af8d4f06657906024861 (patch) | |
tree | 9205dd82c4614d14104cd27a2ac4ddde42a3d8bf /xlators/cluster/afr/src/afr-common.c | |
parent | eab187ce06f6d72aeba297604e132d181da4c502 (diff) |
cluster/afr: Handle files without gfid
Change-Id: Ie831ae8542c1382c17fb7837cd18b0e4e4d3db75
BUG: 3734
Reviewed-on: http://review.gluster.com/619
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-common.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 69e980a03..bc8c828e5 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -456,10 +456,14 @@ afr_local_sh_cleanup (afr_local_t *local, xlator_t *this) if (sh->child_success) GF_FREE (sh->child_success); + if (sh->fresh_children) + GF_FREE (sh->fresh_children); if (sh->fresh_parent_dirs) GF_FREE (sh->fresh_parent_dirs); loc_wipe (&sh->parent_loc); + loc_wipe (&sh->lookup_loc); + } @@ -980,12 +984,12 @@ afr_launch_self_heal (call_frame_t *frame, xlator_t *this, afr_self_heal (frame, this, inode); } -int +unsigned int afr_gfid_missing_count (const char *xlator_name, int32_t *success_children, struct iatt *bufs, unsigned int child_count, const char *path) { - int gfid_miss_count = 0; + unsigned int gfid_miss_count = 0; int i = 0; struct iatt *child1 = NULL; @@ -1538,6 +1542,7 @@ afr_lookup_cont_init (afr_local_t *local, unsigned int child_count) int32_t *child_success = NULL; struct iatt *iatts = NULL; int i = 0; + int32_t *sources = NULL; GF_ASSERT (local); local->cont.lookup.xattrs = GF_CALLOC (child_count, @@ -1565,6 +1570,11 @@ afr_lookup_cont_init (afr_local_t *local, unsigned int child_count) local->cont.lookup.child_success = child_success; + sources = GF_CALLOC (sizeof (*sources), child_count, gf_afr_mt_int32_t); + if (NULL == sources) + goto out; + + local->cont.lookup.sources = sources; ret = 0; out: return ret; @@ -3188,21 +3198,19 @@ afr_reset_children (int32_t *fresh_children, int32_t child_count) } int32_t* -afr_fresh_children_create (int32_t child_count) +afr_children_create (unsigned int child_count) { - int32_t *fresh_children = NULL; + int32_t *children = NULL; int i = 0; - GF_ASSERT (child_count > 0); - - fresh_children = GF_CALLOC (child_count, sizeof (*fresh_children), - gf_afr_mt_int32_t); - if (NULL == fresh_children) + children = GF_CALLOC (child_count, sizeof (*children), + gf_afr_mt_int32_t); + if (NULL == children) goto out; for (i = 0; i < child_count; i++) - fresh_children[i] = -1; + children[i] = -1; out: - return fresh_children; + return children; } void |