diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-04-23 04:26:24 +0000 |
---|---|---|
committer | Krishnan Parthasarathi <kparthas@redhat.com> | 2014-05-06 00:24:39 -0700 |
commit | f846e54b8844decbc8bd73840e7d35b2dcaed2e0 (patch) | |
tree | e0f7be12df60b59c42651cd50bd683510e7cce24 /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | a05c579f1c3695c4ddead0a5cfc2c92422bd4f8f (diff) |
glusterd: Fetch brick mount_dirs during brick create.
Fetch the mount directory path for a brick, during
volume create, add-brick, and replace-brick.
When a snap-create is missed, use this mount directory
information to create the brick path for the missed snap brick.
Change-Id: Iad3eec96a32cf340f26bdf3f28e2f529e4b77e31
BUG: 1061685
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7550
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com>
Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index eda176d1b6b..5b1d80e84aa 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -294,6 +294,14 @@ glusterd_store_brickinfo_write (int fd, glusterd_brickinfo_t *brickinfo) goto out; } + if (strlen(brickinfo->mount_dir) > 0) { + snprintf (value, sizeof(value), "%s", brickinfo->mount_dir); + ret = gf_store_save_value (fd, + GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR, value); + if (ret) + goto out; + } + snprintf (value, sizeof(value), "%d", brickinfo->snap_status); ret = gf_store_save_value (fd, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS, value); @@ -2073,6 +2081,10 @@ glusterd_store_retrieve_bricks (glusterd_volinfo_t *volinfo) strlen (GLUSTERD_STORE_KEY_BRICK_DEVICE_PATH))) { strncpy (brickinfo->device_path, value, sizeof (brickinfo->device_path)); + } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR, + strlen (GLUSTERD_STORE_KEY_BRICK_MOUNT_DIR))) { + strncpy (brickinfo->mount_dir, value, + sizeof (brickinfo->mount_dir)); } else if (!strncmp (key, GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS, strlen (GLUSTERD_STORE_KEY_BRICK_SNAP_STATUS))) { gf_string2int (value, &brickinfo->snap_status); |