summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-09-15 04:47:50 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-16 07:11:37 -0700
commit9fd8f212bc1f6031b9ad7eaaf014d39916881947 (patch)
tree788a6950630ee1df028c9d5cddecee038fe9fc49 /libglusterfs
parentdcfc4bdd5962ad18665d9ad3f3309884c941845e (diff)
Dumop inodectx added
Added dumpop inodectx. Support for dumop inodectx added in dht, locks and client-protocol. Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 213 (Support for process state dump) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=213
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/inode.c15
-rw-r--r--libglusterfs/src/xlator.h3
2 files changed, 18 insertions, 0 deletions
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 {