From b59296014303ae93367b8c38f158b3db28fbbe35 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Wed, 22 Aug 2012 18:05:44 +0530 Subject: protocol/server: dump the ltable and fd table related inodes only Do not dump the entire inode table in the statedump. Instead dump those inodes only which are present in fdtable or ltable. Change-Id: If848f9a6198927b4cc0abd47339461f3ea41d6df BUG: 844688 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/3848 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- libglusterfs/src/fd.c | 7 +++++++ libglusterfs/src/statedump.c | 14 ++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/fd.c b/libglusterfs/src/fd.c index 246539b7..03e8f939 100644 --- a/libglusterfs/src/fd.c +++ b/libglusterfs/src/fd.c @@ -960,6 +960,13 @@ fd_dump (fd_t *fd, char *prefix) gf_proc_dump_write("pid", "%llu", fd->pid); gf_proc_dump_write("refcount", "%d", fd->refcount); gf_proc_dump_write("flags", "%d", fd->flags); + + if (fd->inode) { + gf_proc_dump_build_key (key, "inode", NULL); + gf_proc_dump_add_section(key); + inode_dump (fd->inode, key); + } + } diff --git a/libglusterfs/src/statedump.c b/libglusterfs/src/statedump.c index 8eac7287..8e7e905f 100644 --- a/libglusterfs/src/statedump.c +++ b/libglusterfs/src/statedump.c @@ -435,8 +435,6 @@ gf_proc_dump_xlator_info (xlator_t *top) (trav->itable)) { snprintf (itable_key, 1024, "%d.%s.itable", ctx->graph_id, trav->name); - - inode_table_dump (trav->itable, itable_key); } if (!trav->dumpops) { @@ -470,24 +468,20 @@ static void gf_proc_dump_oldgraph_xlator_info (xlator_t *top) { xlator_t *trav = NULL; - glusterfs_ctx_t *ctx = NULL; - char itable_key[1024] = {0,}; if (!top) return; - ctx = top->ctx; - trav = top; while (trav) { gf_proc_dump_xlator_mem_info_only_in_use (trav); if (GF_PROC_DUMP_IS_XL_OPTION_ENABLED (inode) && (trav->itable)) { - snprintf (itable_key, 1024, "%d.%s.itable", - ctx->graph_id, trav->name); - - inode_table_dump (trav->itable, itable_key); + /*TODO: dump inode table info if necessary by + printing the graph id (taken by glusterfs_cbtx_t) + in the key + */ } if (!trav->dumpops) { -- cgit