summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2014-09-30 17:47:26 +0200
committerVijay Bellur <vbellur@redhat.com>2014-10-03 02:00:46 -0700
commit7e76bd24305ee29506dd11be5a0691cfa65b6d0c (patch)
tree353e5ab7a64358418db794e52ddc7312b1a04d0b /xlators/cluster
parent0a8371bdfdd88e662d09def717cc0b822feb64e8 (diff)
ec: Add state dump support
Change-Id: I4504f3050674dde217e79af28cb4d2b5370fe2d5 BUG: 1148010 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/8891 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Emmanuel Dreyfus <manu@netbsd.org> Tested-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/ec/src/ec.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/xlators/cluster/ec/src/ec.c b/xlators/cluster/ec/src/ec.c
index 93bee1a4d32..545d109af9f 100644
--- a/xlators/cluster/ec/src/ec.c
+++ b/xlators/cluster/ec/src/ec.c
@@ -19,8 +19,10 @@
*/
#include "defaults.h"
+#include "statedump.h"
#include "ec-mem-types.h"
+#include "ec-helpers.h"
#include "ec-common.h"
#include "ec-fops.h"
#include "ec-method.h"
@@ -830,6 +832,30 @@ int32_t ec_gf_releasedir(xlator_t * this, fd_t * fd)
return 0;
}
+int32_t ec_dump_private(xlator_t *this)
+{
+ ec_t *ec = NULL;
+ char key_prefix[GF_DUMP_MAX_BUF_LEN];
+ char tmp[65];
+
+ GF_ASSERT(this);
+
+ ec = this->private;
+ GF_ASSERT(ec);
+
+ snprintf(key_prefix, GF_DUMP_MAX_BUF_LEN, "%s.%s", this->type, this->name);
+ gf_proc_dump_add_section(key_prefix);
+ gf_proc_dump_write("nodes", "%u", ec->nodes);
+ gf_proc_dump_write("redundancy", "%u", ec->redundancy);
+ gf_proc_dump_write("fragment_size", "%u", ec->fragment_size);
+ gf_proc_dump_write("stripe_size", "%u", ec->stripe_size);
+ gf_proc_dump_write("childs_up", "%u", ec->xl_up_count);
+ gf_proc_dump_write("childs_up_mask", "%s",
+ ec_bin(tmp, sizeof(tmp), ec->xl_up, ec->nodes));
+
+ return 0;
+}
+
struct xlator_fops fops =
{
.lookup = ec_gf_lookup,
@@ -884,6 +910,10 @@ struct xlator_cbks cbks =
.releasedir = ec_gf_releasedir
};
+struct xlator_dumpops dumpops = {
+ .priv = ec_dump_private
+};
+
struct volume_options options[] =
{
{