summaryrefslogtreecommitdiffstats
path: root/xlators/features/shard
diff options
context:
space:
mode:
authorKrutika Dhananjay <kdhananj@redhat.com>2015-10-12 13:12:46 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-10-13 23:22:58 -0700
commita623ece32242bb0b5af4bae07b2c5eb9094faf47 (patch)
tree2ac6bf5334459ec2a9bc8292928875631b136e97 /xlators/features/shard
parent613f5c0120068a117f7337eeda293512bf106ef8 (diff)
features/shard: Dump private members and addresses in statedump
Backport of: http://review.gluster.org/12334 Change-Id: I35c4dcb4937edcb39e1e6a15655f53be0417ac2a BUG: 1271204 Signed-off-by: Krutika Dhananjay <kdhananj@redhat.com> Reviewed-on: http://review.gluster.org/12348 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/features/shard')
-rw-r--r--xlators/features/shard/src/shard.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c
index 2c33faf6a5f..6e688427fb4 100644
--- a/xlators/features/shard/src/shard.c
+++ b/xlators/features/shard/src/shard.c
@@ -14,6 +14,7 @@
#include "shard-mem-types.h"
#include "byte-order.h"
#include "defaults.h"
+#include "statedump.h"
static gf_boolean_t
__is_shard_dir (uuid_t gfid)
@@ -4450,7 +4451,20 @@ shard_release (xlator_t *this, fd_t *fd)
int
shard_priv_dump (xlator_t *this)
{
- /* TBD */
+ shard_priv_t *priv = NULL;
+ char key_prefix[GF_DUMP_MAX_BUF_LEN] = {0,};
+
+ priv = this->private;
+
+ 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 ("shard-block-size", "%s",
+ gf_uint64_2human_readable (priv->block_size));
+ gf_proc_dump_write ("inode-count", "%d", priv->inode_count);
+ gf_proc_dump_write ("ilist_head", "%p", &priv->ilist_head);
+ gf_proc_dump_write ("lru-max-limit", "%d", SHARD_MAX_INODES);
+
return 0;
}