From 9fd8f212bc1f6031b9ad7eaaf014d39916881947 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Tue, 15 Sep 2009 04:47:50 +0000 Subject: Dumop inodectx added Added dumpop inodectx. Support for dumop inodectx added in dht, locks and client-protocol. Signed-off-by: Anand V. Avati BUG: 213 (Support for process state dump) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213 --- libglusterfs/src/inode.c | 15 +++++++++++++++ libglusterfs/src/xlator.h | 3 +++ 2 files changed, 18 insertions(+) (limited to 'libglusterfs') diff --git a/libglusterfs/src/inode.c b/libglusterfs/src/inode.c index 06f742cc625..ff65d101ec3 100644 --- a/libglusterfs/src/inode.c +++ b/libglusterfs/src/inode.c @@ -1213,6 +1213,8 @@ inode_dump (inode_t *inode, char *prefix) { char key[GF_DUMP_MAX_BUF_LEN]; int ret = -1; + xlator_t *xl = NULL; + int i = 0; if (!inode) return; @@ -1236,6 +1238,19 @@ inode_dump (inode_t *inode, char *prefix) gf_proc_dump_build_key(key, prefix, "st_mode"); gf_proc_dump_write(key, "%d", inode->st_mode); UNLOCK(&inode->lock); + if (!inode->_ctx) + goto out; + + for (i = 0; i < inode->table->xl->ctx->xl_count; i++) { + if (inode->_ctx[i].key) { + xl = (xlator_t *)(long)inode->_ctx[i].key; + if (xl->dumpops && xl->dumpops->inodectx) + xl->dumpops->inodectx (xl, inode); + } + } + +out: + return; } void diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 2e815af911a..4adbec2e5d8 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -812,11 +812,14 @@ typedef int32_t (*dumpop_inode_t) (xlator_t *this); typedef int32_t (*dumpop_fd_t) (xlator_t *this); +typedef int32_t (*dumpop_inodectx_t) (xlator_t *this, inode_t *ino); + struct xlator_dumpops { dumpop_priv_t priv; dumpop_inode_t inode; dumpop_fd_t fd; + dumpop_inodectx_t inodectx; }; typedef struct xlator_list { -- cgit