summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPranith K <pranithk@gluster.com>2010-10-02 05:31:55 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-02 06:30:05 -0700
commit99ff5f22db3404abbbab6e7d7edabe930762118d (patch)
treecef1ac559468aaad442be3d1c2d6cc8b6bdb2ed7 /xlators
parent0ac18907614886fa00858b6a1abfeb099b49348a (diff)
mgmt/glusterd: destroy frames in callback
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1726 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1726
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd.h9
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c8
2 files changed, 17 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.h b/xlators/mgmt/glusterd/src/glusterd.h
index 5470e7774e3..b11ce09fb65 100644
--- a/xlators/mgmt/glusterd/src/glusterd.h
+++ b/xlators/mgmt/glusterd/src/glusterd.h
@@ -248,6 +248,15 @@ typedef ssize_t (*gd_serialize_t) (struct iovec outmsg, void *args);
volpath, hostname, exp_path); \
}
+#define GLUSTERD_STACK_DESTROY(frame) do {\
+ void *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY (frame->root);\
+ } while (0)
+
int32_t
glusterd_brick_from_brickinfo (glusterd_brickinfo_t *brickinfo,
char **new_brick);
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index 24035428ed0..76b8b9987b6 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -141,6 +141,7 @@ glusterd3_1_probe_cbk (struct rpc_req *req, struct iovec *iov,
out:
if (rsp.hostname)
free (rsp.hostname);//malloced by xdr
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -236,6 +237,7 @@ glusterd3_1_friend_add_cbk (struct rpc_req * req, struct iovec *iov,
out:
if (rsp.hostname)
free (rsp.hostname);//malloced by xdr
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -330,6 +332,7 @@ respond:
if (rsp.hostname)
free (rsp.hostname);//malloced by xdr
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -366,6 +369,7 @@ glusterd3_1_friend_update_cbk (struct rpc_req *req, struct iovec *iov,
(op_ret)?"RJT":"ACC", str);
out:
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
int32_t
@@ -424,6 +428,7 @@ glusterd3_1_cluster_lock_cbk (struct rpc_req *req, struct iovec *iov,
}
out:
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -484,6 +489,7 @@ glusterd3_1_cluster_unlock_cbk (struct rpc_req *req, struct iovec *iov,
}
out:
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -553,6 +559,7 @@ glusterd3_1_stage_op_cbk (struct rpc_req *req, struct iovec *iov,
out:
if (rsp.op_errstr && strcmp (rsp.op_errstr, "error"))
free (rsp.op_errstr); //malloced by xdr
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}
@@ -715,6 +722,7 @@ out:
dict_unref (dict);
if (rsp.op_errstr && strcmp (rsp.op_errstr, "error"))
free (rsp.op_errstr); //malloced by xdr
+ GLUSTERD_STACK_DESTROY (((call_frame_t *)myframe));
return ret;
}