summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index be96884d098..787352e93f6 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -418,26 +418,9 @@ out:
gf_boolean_t
glusterd_check_volume_exists (char *volname)
{
- char pathname[1024] = {0,};
- struct stat stbuf = {0,};
- int32_t ret = -1;
- glusterd_conf_t *priv = NULL;
-
- priv = THIS->private;
-
- snprintf (pathname, 1024, "%s/vols/%s", priv->workdir,
- volname);
-
- ret = stat (pathname, &stbuf);
+ glusterd_volinfo_t *volinfo = NULL;
- if (ret) {
- gf_log (THIS->name, GF_LOG_DEBUG, "Volume %s does not exist."
- "stat failed with errno : %d on path: %s",
- volname, errno, pathname);
- return _gf_false;
- }
-
- return _gf_true;
+ return (glusterd_volinfo_find (volname, &volinfo) == 0);
}
glusterd_volinfo_t *