diff options
author | Ravishankar N <ravishankar@redhat.com> | 2015-09-23 08:27:25 +0530 |
---|---|---|
committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-09-23 04:17:30 -0700 |
commit | 98fe4297131361d62d6579d0bde10a8485e4748a (patch) | |
tree | 409004db02ebb2964ca8bf056bb72a146262a4f6 | |
parent | 6838a5b342b40099d09ccdce6af8c6f769cccf39 (diff) | |
download | glusterfs-98fe4297131361d62d6579d0bde10a8485e4748a.tar.gz glusterfs-98fe4297131361d62d6579d0bde10a8485e4748a.tar.xz glusterfs-98fe4297131361d62d6579d0bde10a8485e4748a.zip |
heal: remove glfsh_print_brick()
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: 1265470
Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Reviewed-on: http://review.gluster.org/12212
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>
Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
-rw-r--r-- | heal/src/glfs-heal.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c index 3b3003ece6..207e47297b 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) { |