diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2015-02-11 17:13:45 +0530 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2015-02-20 04:04:08 -0800 |
commit | 9d842f965655bf70c643b4541844e83bc4e74190 (patch) | |
tree | 4d248f27d77993a478267a41e0517228214d7fa0 /xlators/mgmt/glusterd/src/glusterd-quota.c | |
parent | 571a71f0acd0ec59340b9d0d2519793e33a1dc16 (diff) |
glusterd: nfs,shd,quotad,snapd daemons refactoring
This patch ports nfs, shd, quotad & snapd with the approach suggested in
http://www.gluster.org/pipermail/gluster-devel/2014-December/043180.html
Change-Id: I4ea5b38793f87fc85cc9d2cf873727351dedffd2
BUG: 1191486
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com>
Reviewed-on: http://review.gluster.org/9428
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Nekkunti <anekkunt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-quota.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-quota.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-quota.c b/xlators/mgmt/glusterd/src/glusterd-quota.c index 5e15fde082a..48dc4b7b39e 100644 --- a/xlators/mgmt/glusterd/src/glusterd-quota.c +++ b/xlators/mgmt/glusterd/src/glusterd-quota.c @@ -19,6 +19,8 @@ #include "glusterd-op-sm.h" #include "glusterd-store.h" #include "glusterd-utils.h" +#include "glusterd-nfs-svc.h" +#include "glusterd-quotad-svc.h" #include "glusterd-volgen.h" #include "run.h" #include "syscall.h" @@ -1007,17 +1009,27 @@ glusterd_set_quota_option (glusterd_volinfo_t *volinfo, dict_t *dict, static int glusterd_quotad_op (int opcode) { - int ret = -1; + int ret = -1; + xlator_t *this = NULL; + glusterd_conf_t *priv = NULL; + + this = THIS; + GF_ASSERT (this); + + priv = this->private; + GF_ASSERT (priv); switch (opcode) { case GF_QUOTA_OPTION_TYPE_ENABLE: case GF_QUOTA_OPTION_TYPE_DISABLE: if (glusterd_all_volumes_with_quota_stopped ()) - ret = glusterd_quotad_stop (); + ret = glusterd_svc_stop (&(priv->quotad_svc), + SIGTERM); else - ret = glusterd_check_generate_start_quotad_wait - (); + ret = priv->quotad_svc.manager + (&(priv->quotad_svc), NULL, + PROC_START); break; default: @@ -1167,7 +1179,7 @@ glusterd_op_quota (dict_t *dict, char **op_errstr, dict_t *rsp_dict) if (GLUSTERD_STATUS_STARTED == volinfo->status) { if (priv->op_version == GD_OP_VERSION_MIN) - ret = glusterd_check_generate_start_nfs (); + ret = priv->nfs_svc.manager (&(priv->nfs_svc), NULL, 0); } if (rsp_dict && start_crawl == _gf_true) |