summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-01 13:01:23 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-01 11:43:51 -0700
commit1d6e57d4a8bf4d69f724774d019f3cb7b4c0e1c3 (patch)
tree752a6c09bb482dd764edf2de3208723bc213ff27 /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent5772cbf49f331557a217f1e31b681afa8d94080a (diff)
mgmt/glusterd: gnfs support in gluster command line
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1319 (gnfs support in gluster command line) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1319
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 1f8bb55ed54..ea3e59b68fb 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -289,6 +289,30 @@ out:
return ret;
}
+static int
+glusterd_check_generate_start_nfs (glusterd_volinfo_t *volinfo)
+{
+ int ret = -1;
+
+ if (!volinfo) {
+ gf_log ("", GF_LOG_ERROR, "Invalid Arguments");
+ goto out;
+ }
+
+ ret = volgen_generate_nfs_volfile (volinfo);
+ if (ret)
+ goto out;
+
+ if (glusterd_is_nfs_started ()) {
+ ret = glusterd_nfs_server_stop ();
+ if (ret)
+ goto out;
+ }
+
+ ret = glusterd_nfs_server_start ();
+out:
+ return ret;
+}
static int
glusterd_op_stage_create_volume (gd1_mgmt_stage_op_req *req)
@@ -1181,7 +1205,8 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req)
if (ret)
goto out;
-
+ if (GLUSTERD_STATUS_STARTED == volinfo->status)
+ ret = glusterd_check_generate_start_nfs (volinfo);
out:
if (dict)
@@ -2151,7 +2176,8 @@ glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
if (ret)
goto out;
-
+ if (GLUSTERD_STATUS_STARTED == volinfo->status)
+ ret = glusterd_check_generate_start_nfs (volinfo);
out:
if (dict)
@@ -2247,6 +2273,10 @@ glusterd_op_start_volume (gd1_mgmt_stage_op_req *req)
goto out;
ret = glusterd_volume_compute_cksum (volinfo);
+ if (ret)
+ goto out;
+
+ ret = glusterd_check_generate_start_nfs (volinfo);
out:
return ret;
@@ -2496,6 +2526,16 @@ glusterd_op_stop_volume (gd1_mgmt_stage_op_req *req)
ret = glusterd_volume_compute_cksum (volinfo);
+ if (glusterd_are_all_volumes_stopped ()) {
+ if (glusterd_is_nfs_started ()) {
+ ret = glusterd_nfs_server_stop ();
+ if (ret)
+ goto out;
+ }
+ } else {
+ ret = glusterd_check_generate_start_nfs (volinfo);
+ }
+
out:
if (flags & GF_CLI_FLAG_OP_FORCE)
ret = 0;