diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-08-23 03:51:21 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-08-23 02:53:16 -0700 |
commit | df4a7d75765b042ddbda4cbcd419743a37767ec3 (patch) | |
tree | 4a04c3720ad869869deb3d7d42c63252b2d7772a /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | 39dc05e370286a62428a94e3e7666e2eedaea941 (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-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 16 |
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 2cee89516db..ee47696da96 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; |