From 32451a4dd02bdd95ec800d51267d2e6be43914a4 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Wed, 14 Jul 2010 00:20:28 +0000 Subject: Fixes a crash seen in create volume Also includes some re-factoring changes. Signed-off-by: Vijay Bellur Signed-off-by: Anand V. Avati BUG: 1063 (gluster volume create command segfaults) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1063 --- xlators/mgmt/glusterd/src/glusterd-op-sm.h | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.h') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.h b/xlators/mgmt/glusterd/src/glusterd-op-sm.h index 61bdc8885..e080acee7 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.h +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.h @@ -133,12 +133,17 @@ typedef struct glusterd_op_lock_ctx_ glusterd_op_lock_ctx_t; struct glusterd_op_stage_ctx_ { rpcsvc_request_t *req; - void *stage_req; + gd1_mgmt_stage_op_req stage_req; }; typedef struct glusterd_op_stage_ctx_ glusterd_op_stage_ctx_t; -typedef glusterd_op_stage_ctx_t glusterd_op_commit_ctx_t; +struct glusterd_op_commit_ctx_ { + rpcsvc_request_t *req; + gd1_mgmt_stage_op_req stage_req; +}; + +typedef struct glusterd_op_commit_ctx_ glusterd_op_commit_ctx_t; int glusterd_op_sm_new_event (glusterd_op_sm_event_type_t event_type, @@ -158,9 +163,20 @@ glusterd_op_set_ctx (glusterd_op_t op, void *ctx); int32_t glusterd_op_set_op (glusterd_op_t op); -int +int32_t +glusterd_op_clear_pending_op (glusterd_op_t op); + +int32_t +glusterd_op_clear_commit_op (glusterd_op_t op); + +int glusterd_op_build_payload (glusterd_op_t op, gd1_mgmt_stage_op_req **req); +int32_t +glusterd_op_stage_validate (gd1_mgmt_stage_op_req *req); + +int32_t +glusterd_op_commit_perform (gd1_mgmt_stage_op_req *req); void * glusterd_op_get_ctx (glusterd_op_t op); -- cgit