From fe5927b6bd1ed795c9e85996e7c54c3abe36ceba Mon Sep 17 00:00:00 2001 From: Vijaikumar M Date: Fri, 14 Feb 2014 20:01:38 +0530 Subject: glusterd/snapshot: store location for snap driven changes Currently snapshot volfiles are stored at: /vols//snaps/ With snap driven approach we need to store the volfiles at: /snaps// Change-Id: I8efdd5db29833b2b06b64a900cbb4c9b9a5d36b6 Signed-off-by: Vijaikumar M Signed-off-by: Sachin Pandit Reviewed-on: http://review.gluster.org/7006 Reviewed-by: Avra Sengupta Reviewed-by: Rajesh Joseph Tested-by: Rajesh Joseph --- xlators/mgmt/glusterd/src/glusterd-op-sm.c | 32 +++++------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index c0c72445b..625434bc8 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1544,40 +1544,18 @@ glusterd_start_bricks (glusterd_volinfo_t *volinfo) { int ret = -1; glusterd_brickinfo_t *brickinfo = NULL; - glusterd_volinfo_t *parent_volinfo = NULL; GF_ASSERT (volinfo); - if (volinfo->is_snap_volume == _gf_true) { - ret = glusterd_volinfo_find (volinfo->parent_volname, &parent_volinfo); + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { + ret = glusterd_brick_start (volinfo, brickinfo, _gf_false); if (ret) { gf_log (THIS->name, GF_LOG_ERROR, - "Unable to find parent volume %s for snap %s", - volinfo->parent_volname, volinfo->volname); + "Failed to start %s:%s for %s", + brickinfo->hostname, brickinfo->path, + volinfo->volname); goto out; } - list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { - ret = glusterd_snap_brick_start (parent_volinfo, volinfo, - brickinfo, _gf_false); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, - "Failed to start %s:%s for %s", - brickinfo->hostname, brickinfo->path, - volinfo->volname); - goto out; - } - } - } else { - list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { - ret = glusterd_brick_start (volinfo, brickinfo, _gf_false); - if (ret) { - gf_log (THIS->name, GF_LOG_ERROR, - "Failed to start %s:%s for %s", - brickinfo->hostname, brickinfo->path, - volinfo->volname); - goto out; - } - } } ret = 0; -- cgit