summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-syncop.h
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-12-20 14:54:35 +0530
committerAnand Avati <avati@redhat.com>2012-03-21 11:58:11 -0700
commitc3bdb1d4c6c4491afdf1ba26bb0d6204270cc058 (patch)
treef1d3e6e9adb2146754ee1a0ec12bd0ea4014ef03 /xlators/mgmt/glusterd/src/glusterd-syncop.h
parent8217148c97a474a9eab4a309589ceb8ff281f5c6 (diff)
glusterd: bring in feature to use syncop for mgmt ops
* new sycnop routines added to mgmt program * one should not use 'glusterd_op_begin()', instead can use the synctask framework, 'glusterd_op_begin_synctask()' * currently using for below operations: 'volume start', 'volume rebalance', 'volume quota', 'volume replace-brick' and 'volume add-brick' Change-Id: I0bee76d06790d5c5bb5db15d443b44af0e21f1c0 BUG: 762935 Signed-off-by: Amar Tumballi <amar@gluster.com> Reviewed-on: http://review.gluster.com/479 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-syncop.h')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.h b/xlators/mgmt/glusterd/src/glusterd-syncop.h
new file mode 100644
index 000000000..ccaf794ea
--- /dev/null
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.h
@@ -0,0 +1,54 @@
+/*
+ Copyright (c) 2012 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ GlusterFS is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3 of the License,
+ or (at your option) any later version.
+
+ GlusterFS is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef __RPC_SYNCOP_H
+#define __RPC_SYNCOP_H
+
+#include "syncop.h"
+
+
+/* gd_syncop_* */
+#define GD_SYNCOP(rpc, stb, cbk, req, prog, procnum, xdrproc) do { \
+ int ret = 0; \
+ ret = gd_syncop_submit_request (rpc, req, stb, \
+ prog, procnum, cbk, \
+ (xdrproc_t)xdrproc); \
+ if (!ret) \
+ __yield (stb); \
+ } while (0)
+
+
+int gd_syncop_submit_request (struct rpc_clnt *rpc, void *req,
+ void *cookie, rpc_clnt_prog_t *prog,
+ int procnum, fop_cbk_fn_t cbkfn,
+ xdrproc_t xdrproc);
+
+
+int gd_syncop_mgmt_lock (struct rpc_clnt *rpc, uuid_t my_uuid,
+ uuid_t recv_uuid);
+int gd_syncop_mgmt_unlock (struct rpc_clnt *rpc, uuid_t my_uuid,
+ uuid_t recv_uuid);
+int gd_syncop_mgmt_stage_op (struct rpc_clnt *rpc, uuid_t my_uuid,
+ uuid_t recv_uuid, int op, dict_t *dict_out,
+ dict_t **dict_in, char **errstr);
+int gd_syncop_mgmt_commit_op (struct rpc_clnt *rpc, uuid_t my_uuid,
+ uuid_t recv_uuid, int op, dict_t *dict_out,
+ dict_t **dict_in, char **errstr);
+
+#endif /* __RPC_SYNCOP_H */