summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-store.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-store.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c
index 2cee89516..ee47696da 100644
--- a/xlators/mgmt/glusterd/src/glusterd-store.c
+++ b/xlators/mgmt/glusterd/src/glusterd-store.c
@@ -134,9 +134,9 @@ glusterd_store_create_brick (glusterd_volinfo_t *volinfo,
snprintf (buf, sizeof(buf), "hostname=%s\n", brickinfo->hostname);
- write (fd, buf, strlen(buf));
+ ret = write (fd, buf, strlen(buf));
snprintf (buf, sizeof(buf), "path=%s\n", brickinfo->path);
- write (fd, buf, strlen(buf));
+ ret = write (fd, buf, strlen(buf));
ret = 0;
@@ -293,18 +293,24 @@ glusterd_store_create_volume (glusterd_volinfo_t *volinfo)
if (ret)
goto out;
- snprintf (buf, sizeof (buf), "%d", volinfo->status);
+/* snprintf (buf, sizeof (buf), "%d", volinfo->port);
ret = glusterd_store_save_value (volinfo->shandle,
GLUSTERD_STORE_KEY_VOL_PORT, buf);
if (ret)
goto out;
-
+*/
snprintf (buf, sizeof (buf), "%d", volinfo->sub_count);
ret = glusterd_store_save_value (volinfo->shandle,
GLUSTERD_STORE_KEY_VOL_SUB_COUNT, buf);
if (ret)
goto out;
+ snprintf (buf, sizeof (buf), "%d", volinfo->version);
+ ret = glusterd_store_save_value (volinfo->shandle,
+ GLUSTERD_STORE_KEY_VOL_VERSION, buf);
+ if (ret)
+ goto out;
+
list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
ret = glusterd_store_create_brick (volinfo, brickinfo);
if (ret)
@@ -328,7 +334,7 @@ int32_t
glusterd_store_delete_volume (glusterd_volinfo_t *volinfo)
{
char pathname[PATH_MAX] = {0,};
- int32_t ret = -1;
+ int32_t ret = 0;
glusterd_conf_t *priv = NULL;
DIR *dir = NULL;
struct dirent *entry = NULL;