summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr.c')
-rw-r--r--xlators/cluster/afr/src/afr.c45
1 files changed, 31 insertions, 14 deletions
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index f81b8005da0..57af6f34225 100644
--- a/xlators/cluster/afr/src/afr.c
+++ b/xlators/cluster/afr/src/afr.c
@@ -289,19 +289,12 @@ afr_local_sh_cleanup (afr_local_t *local, xlator_t *this)
}
-void
-afr_local_cleanup (afr_local_t *local, xlator_t *this)
+void
+afr_local_transaction_cleanup (afr_local_t *local, xlator_t *this)
{
- int i;
+ int i = 0;
afr_private_t * priv = NULL;
- if (!local)
- return;
-
- afr_local_sh_cleanup (local, this);
-
- FREE (local->child_errno);
-
priv = this->private;
for (i = 0; i < priv->child_count; i++) {
@@ -311,17 +304,35 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this)
FREE (local->pending);
- loc_wipe (&local->loc);
- loc_wipe (&local->newloc);
-
FREE (local->transaction.locked_nodes);
FREE (local->transaction.child_errno);
+ FREE (local->child_errno);
FREE (local->transaction.basename);
FREE (local->transaction.new_basename);
- loc_wipe (&local->transaction.parent_loc);
+ loc_wipe (&local->transaction.parent_loc);
loc_wipe (&local->transaction.new_parent_loc);
+}
+
+
+void
+afr_local_cleanup (afr_local_t *local, xlator_t *this)
+{
+ int i;
+ afr_private_t * priv = NULL;
+
+ if (!local)
+ return;
+
+ afr_local_sh_cleanup (local, this);
+
+ afr_local_transaction_cleanup (local, this);
+
+ priv = this->private;
+
+ loc_wipe (&local->loc);
+ loc_wipe (&local->newloc);
if (local->fd)
fd_unref (local->fd);
@@ -1422,6 +1433,12 @@ afr_release (xlator_t *this, fd_t *fd)
if (fd_ctx->child_failed)
FREE (fd_ctx->child_failed);
+ if (fd_ctx->pre_op_done)
+ FREE (fd_ctx->pre_op_done);
+
+ if (fd_ctx->opened_on)
+ FREE (fd_ctx->opened_on);
+
FREE (fd_ctx);
}