From 0fe5ab5b9215b8f0ecfb8bc4ba15a5370850654a Mon Sep 17 00:00:00 2001 From: Varun Shastry Date: Tue, 6 May 2014 12:39:20 +0000 Subject: glusterd: Changes to provide interface for USS The changes which consists of the translators for the USS (User Servicable Snapshots) is submitted as a separate patch. Current patch provides the CLI access to the feature. Change-Id: I6b98a42fcfa82f0870d8048fe0bb53141565e9c6 BUG: 1094815 Signed-off-by: Varun Shastry Reviewed-on: http://review.gluster.org/7705 Tested-by: Gluster Build System Reviewed-by: Atin Mukherjee Reviewed-by: Krishnan Parthasarathi Tested-by: Krishnan Parthasarathi --- xlators/mgmt/glusterd/src/glusterd-handshake.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'xlators/mgmt/glusterd/src/glusterd-handshake.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-handshake.c b/xlators/mgmt/glusterd/src/glusterd-handshake.c index 2901b98d847..115dd8bd145 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handshake.c +++ b/xlators/mgmt/glusterd/src/glusterd-handshake.c @@ -162,6 +162,7 @@ build_volfile_path (const char *volname, char *path, const char *volname_ptr = NULL; char path_prefix [PATH_MAX] = {0,}; xlator_t *this = NULL; + char *volname_tmp = NULL; this = THIS; GF_ASSERT (this); @@ -170,7 +171,18 @@ build_volfile_path (const char *volname, char *path, GF_ASSERT (volname); GF_ASSERT (path); - if (strstr (volname, "gluster/")) { + if (strstr (volname, "snapd/")) { + volname_tmp = strchr (volname, '/') + 1; + ret = glusterd_volinfo_find (volname_tmp, &volinfo); + if (ret == -1) { + gf_log (this->name, GF_LOG_ERROR, + "Couldn't find volinfo"); + goto out; + } + glusterd_get_snapd_volfile (volinfo, path, path_len); + ret = 1; + goto out; + } else if (strstr (volname, "gluster/")) { server = strchr (volname, '/') + 1; glusterd_get_nodesvc_volfile (server, priv->workdir, path, path_len); -- cgit