summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorYaniv Kaul <ykaul@redhat.com>2019-03-19 16:45:06 +0200
committerAtin Mukherjee <amukherj@redhat.com>2019-03-25 05:34:50 +0000
commit4acf03d304e88ca3d10d3d7076208f1462228bbb (patch)
treee333bc06afa3bc253bc3c008e8878429f9fb1d33 /xlators/mgmt/glusterd/src/glusterd-utils.c
parent1f94395c356748c0f51c76d5de3be5f6cf603547 (diff)
Multiple files: remove HAVE_BD_XLATOR related code.
The BD translator was removed some time ago, (in commit a907e468e724c32b9833ce59806fc215c7122d63). This completes the work. Compile-tested only! updates: bz#1635688 Signed-off-by: Yaniv Kaul <ykaul@redhat.com> Change-Id: I999df52e479a72d3cc9523f22f9056de17eb559c
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c82
1 files changed, 0 insertions, 82 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index dd4c02422e3..63cbaa16c1f 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -74,9 +74,6 @@
#include <fnmatch.h>
#include <sys/statvfs.h>
#include <ifaddrs.h>
-#ifdef HAVE_BD_XLATOR
-#include <lvm2app.h>
-#endif
#ifdef GF_SOLARIS_HOST_OS
#include <sys/sockio.h>
@@ -1201,9 +1198,6 @@ glusterd_brickinfo_new_from_brick(char *brick, glusterd_brickinfo_t **brickinfo,
char *path = NULL;
char *tmp_host = NULL;
char *tmp_path = NULL;
-#ifdef HAVE_BD_XLATOR
- char *vg = NULL;
-#endif
int32_t ret = -1;
glusterd_brickinfo_t *new_brickinfo = NULL;
xlator_t *this = NULL;
@@ -1228,18 +1222,6 @@ glusterd_brickinfo_new_from_brick(char *brick, glusterd_brickinfo_t **brickinfo,
if (ret)
goto out;
-#ifdef HAVE_BD_XLATOR
- vg = strchr(path, '?');
- /* ? is used as a delimiter for vg */
- if (vg) {
- if (snprintf(new_brickinfo->vg, PATH_MAX, "%s", vg + 1) >= PATH_MAX) {
- ret = -1;
- goto out;
- }
- *vg = '\0';
- }
- new_brickinfo->caps = CAPS_BD;
-#endif
ret = gf_canonicalize_path(path);
if (ret)
goto out;
@@ -1408,63 +1390,6 @@ out:
return available;
}
-#ifdef HAVE_BD_XLATOR
-/*
- * Sets the tag of the format "trusted.glusterfs.volume-id:<uuid>" in
- * the brick VG. It is used to avoid using same VG for another brick.
- * @volume-id - gfid, @brick - brick info, @msg - Error message returned
- * to the caller
- */
-int
-glusterd_bd_set_vg_tag(unsigned char *volume_id, glusterd_brickinfo_t *brick,
- char *msg, int msg_size)
-{
- lvm_t handle = NULL;
- vg_t vg = NULL;
- char *uuid = NULL;
- int ret = -1;
-
- gf_asprintf(&uuid, "%s:%s", GF_XATTR_VOL_ID_KEY, uuid_utoa(volume_id));
- if (!uuid) {
- snprintf(msg, sizeof(*msg),
- "Could not allocate memory "
- "for tag");
- return -1;
- }
-
- handle = lvm_init(NULL);
- if (!handle) {
- snprintf(msg, sizeof(*msg), "lvm_init failed");
- goto out;
- }
-
- vg = lvm_vg_open(handle, brick->vg, "w", 0);
- if (!vg) {
- snprintf(msg, sizeof(*msg), "Could not open VG %s", brick->vg);
- goto out;
- }
-
- if (lvm_vg_add_tag(vg, uuid) < 0) {
- snprintf(msg, sizeof(*msg),
- "Could not set tag %s for "
- "VG %s",
- uuid, brick->vg);
- goto out;
- }
- lvm_vg_write(vg);
- ret = 0;
-out:
- GF_FREE(uuid);
-
- if (vg)
- lvm_vg_close(vg);
- if (handle)
- lvm_quit(handle);
-
- return ret;
-}
-#endif
-
int
glusterd_validate_and_create_brickpath(glusterd_brickinfo_t *brickinfo,
uuid_t volume_id, char *volname,
@@ -1590,13 +1515,6 @@ glusterd_validate_and_create_brickpath(glusterd_brickinfo_t *brickinfo,
}
}
-#ifdef HAVE_BD_XLATOR
- if (brickinfo->vg[0]) {
- ret = glusterd_bd_set_vg_tag(volume_id, brickinfo, msg, sizeof(msg));
- if (ret)
- goto out;
- }
-#endif
ret = glusterd_check_and_set_brick_xattr(
brickinfo->hostname, brickinfo->path, volume_id, op_errstr, is_force);
if (ret)