summaryrefslogtreecommitdiffstats
path: root/heal
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2015-09-23 08:27:25 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-09-27 23:19:30 -0700
commit5f0da098ad9c1280f8c52b44d37e480e56c17913 (patch)
tree12afc19c3173fe953f8f9d28caf1b33b4ca6f2bf /heal
parent56cd506a146c7525646cdda07e2fa81d9079e64f (diff)
heal: remove glfsh_print_brick()
Backport of http://review.gluster.org/#/c/12212/ Use glfsh_print_brick_from_xl() instead so that the hostname:brickpath displayed when heal info is run is consistent with other gluster cli commands like `gluster volume info`. Change-Id: I30ee3d76d0f68991a25bd678d40ec3bf7e0538c7 BUG: 1265633 Signed-off-by: Ravishankar N <ravishankar@redhat.com> (cherry picked from commit 98fe4297131361d62d6579d0bde10a8485e4748a) Reviewed-on: http://review.gluster.org/12220 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'heal')
-rw-r--r--heal/src/glfs-heal.c37
1 files changed, 3 insertions, 34 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index 3b3003ece67..207e47297b5 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -339,35 +339,6 @@ out:
}
static int
-glfsh_print_brick (xlator_t *xl, loc_t *rootloc)
-{
- int ret = 0;
- dict_t *xattr = NULL;
- char *pathinfo = NULL;
- char *brick_start = NULL;
- char *brick_end = NULL;
-
- ret = syncop_getxattr (xl, rootloc, &xattr, GF_XATTR_PATHINFO_KEY,
- NULL, NULL);
- if (ret < 0)
- goto out;
-
- ret = dict_get_str (xattr, GF_XATTR_PATHINFO_KEY, &pathinfo);
- if (ret < 0)
- goto out;
-
- brick_start = strchr (pathinfo, ':') + 1;
- brick_end = pathinfo + strlen (pathinfo) - 1;
- *brick_end = 0;
- printf ("Brick %s\n", brick_start);
-
-out:
- if (xattr)
- dict_unref (xattr);
- return ret;
-}
-
-void
glfsh_print_brick_from_xl (xlator_t *xl)
{
char *remote_host = NULL;
@@ -386,6 +357,7 @@ out:
printf ("Brick - Not able to get brick information\n");
else
printf ("Brick %s:%s\n", remote_host, remote_subvol);
+ return ret;
}
void
@@ -405,12 +377,9 @@ glfsh_print_pending_heals (glfs_t *fs, xlator_t *top_subvol, loc_t *rootloc,
ret = dict_set_int32 (xattr_req, "heal-op", heal_op);
if (ret)
goto out;
- ret = glfsh_print_brick (xl, rootloc);
- if (ret < 0) {
- glfsh_print_brick_from_xl (xl);
- printf ("Status: %s\n", strerror (-ret));
+ ret = glfsh_print_brick_from_xl (xl);
+ if (ret < 0)
goto out;
- }
ret = glfsh_get_index_dir_loc (rootloc, xl, &dirloc, &op_errno);
if (ret < 0) {