summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-08-23 03:51:21 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-08-23 02:53:16 -0700
commitdf4a7d75765b042ddbda4cbcd419743a37767ec3 (patch)
tree4a04c3720ad869869deb3d7d42c63252b2d7772a /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parent39dc05e370286a62428a94e3e7666e2eedaea941 (diff)
glusterd: support for volume version and cksumv3.1.0qa8
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1310 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1310
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index b243e78..3b4b390 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -253,7 +253,7 @@ out:
return ret;
}
-static int
+int
glusterd_volume_create_generate_volfiles (glusterd_volinfo_t *volinfo)
{
int32_t ret = -1;
@@ -800,6 +800,7 @@ glusterd_op_create_volume (gd1_mgmt_stage_op_req *req)
i++;
}
list_add_tail (&volinfo->vol_list, &priv->volumes);
+ volinfo->version++;
ret = glusterd_store_create_volume (volinfo);
@@ -811,6 +812,10 @@ glusterd_op_create_volume (gd1_mgmt_stage_op_req *req)
goto out;
+ ret = glusterd_volume_compute_cksum (volinfo);
+ if (ret)
+ goto out;
+
out:
return ret;
}
@@ -942,6 +947,12 @@ glusterd_op_add_brick (gd1_mgmt_stage_op_req *req)
goto out;
}
+ volinfo->version++;
+
+ ret = glusterd_volume_compute_cksum (volinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_store_update_volume (volinfo);
if (ret)
@@ -1879,6 +1890,12 @@ glusterd_op_remove_brick (gd1_mgmt_stage_op_req *req)
goto out;
}
+ volinfo->version++;
+
+ ret = glusterd_volume_compute_cksum (volinfo);
+ if (ret)
+ goto out;
+
ret = glusterd_store_update_volume (volinfo);
if (ret)