From f9ee09abd29002d8612bcdcbeaf4cf3e404b4cc6 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 26 Mar 2015 16:06:36 +0530 Subject: cluster/ec: Implement heal info for ec This also lists the files that are on-going I/O, which will be fixed later. Change-Id: Ib3f60a8b7e8798d068658cf38eaef2a904f9e327 BUG: 1203581 Signed-off-by: Pranith Kumar K Reviewed-on: http://review.gluster.org/10020 Tested-by: Gluster Build System Reviewed-by: Dan Lambright --- xlators/cluster/ec/src/ec.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'xlators/cluster/ec/src/ec.c') diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c index 9b8251a5403..fd5123d61da 100644 --- a/xlators/cluster/ec/src/ec.c +++ b/xlators/cluster/ec/src/ec.c @@ -594,6 +594,30 @@ ec_marker_populate_args (call_frame_t *frame, int type, int *gauge, return ec->nodes; } +int32_t +ec_handle_heal_commands (call_frame_t *frame, xlator_t *this, loc_t *loc, + const char *name, dict_t *xdata) +{ + dict_t *dict_rsp = NULL; + int op_ret = -1; + int op_errno = ENOMEM; + + if (!name || strcmp (name, GF_HEAL_INFO)) + return -1; + + dict_rsp = dict_new (); + if (dict_rsp == NULL) + goto out; + + if (dict_set_str (dict_rsp, "heal-info", "heal") == 0) + op_ret = 0; +out: + STACK_UNWIND_STRICT (getxattr, frame, op_ret, op_errno, dict_rsp, NULL); + if (dict_rsp) + dict_unref (dict_rsp); + return 0; +} + int32_t ec_gf_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, const char *name, dict_t *xdata) @@ -605,6 +629,9 @@ ec_gf_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, EC_INTERNAL_XATTR_OR_GOTO(name, NULL, error, out); } + if (ec_handle_heal_commands (frame, this, loc, name, xdata) == 0) + return 0; + if (cluster_handle_marker_getxattr (frame, loc, name, ec->vol_uuid, NULL, ec_marker_populate_args) == 0) return 0; -- cgit