diff options
author | Pranith Kumar K <pkarampu@redhat.com> | 2015-03-26 16:06:36 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-30 23:38:49 -0700 |
commit | f9ee09abd29002d8612bcdcbeaf4cf3e404b4cc6 (patch) | |
tree | fb2c18a76cc9fe90ebc9b96949fad71d8bc2538b /xlators/cluster | |
parent | 3feaf1648528ff39e23748ac9004a77595460c9d (diff) |
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 <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/10020
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 2 | ||||
-rw-r--r-- | xlators/cluster/ec/src/ec.c | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index afa40fbad2a..7fed62a5361 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -1477,7 +1477,7 @@ afr_getxattr (call_frame_t *frame, xlator_t *this, afr_marker_populate_args) == 0) return 0; - if (!strcmp (name, GF_AFR_HEAL_INFO)) { + if (!strcmp (name, GF_HEAL_INFO)) { afr_get_heal_info (frame, this, loc, xdata); return 0; } 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 @@ -595,6 +595,30 @@ ec_marker_populate_args (call_frame_t *frame, int type, int *gauge, } 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; |