From 5f0da098ad9c1280f8c52b44d37e480e56c17913 Mon Sep 17 00:00:00 2001 From: Ravishankar N Date: Wed, 23 Sep 2015 08:27:25 +0530 Subject: 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 (cherry picked from commit 98fe4297131361d62d6579d0bde10a8485e4748a) Reviewed-on: http://review.gluster.org/12220 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri --- heal/src/glfs-heal.c | 37 +++---------------------------------- 1 file changed, 3 insertions(+), 34 deletions(-) (limited to 'heal/src') 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) { -- cgit