diff options
author | Vijay Bellur <vijay@gluster.com> | 2009-09-15 04:47:50 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-09-16 07:11:37 -0700 |
commit | 9fd8f212bc1f6031b9ad7eaaf014d39916881947 (patch) | |
tree | 788a6950630ee1df028c9d5cddecee038fe9fc49 /xlators/cluster/dht/src | |
parent | dcfc4bdd5962ad18665d9ad3f3309884c941845e (diff) | |
download | glusterfs-9fd8f212bc1f6031b9ad7eaaf014d39916881947.tar.gz glusterfs-9fd8f212bc1f6031b9ad7eaaf014d39916881947.tar.xz glusterfs-9fd8f212bc1f6031b9ad7eaaf014d39916881947.zip |
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 'xlators/cluster/dht/src')
-rw-r--r-- | xlators/cluster/dht/src/dht.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 24782471e1..46f3b87000 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -166,6 +166,34 @@ dht_priv_dump (xlator_t *this) return 0; } +int32_t +dht_inodectx_dump (xlator_t *this, inode_t *inode) +{ + int ret = -1; + char key_prefix[GF_DUMP_MAX_BUF_LEN]; + dht_layout_t *layout = NULL; + uint64_t tmp_layout = 0; + + if (!inode) + return -1; + + ret = inode_ctx_get (inode, this, &tmp_layout); + + if (ret != 0) + return ret; + + layout = (dht_layout_t *)(long)tmp_layout; + + if (!layout) + return -1; + + gf_proc_dump_build_key(key_prefix, "xlator.cluster.dht", + "%s.inode.%ld", this->name, inode->ino); + dht_layout_dump(layout, key_prefix); + + return 0; +} + int notify (xlator_t *this, int event, void *data, ...) { @@ -373,6 +401,7 @@ struct xlator_mops mops = { struct xlator_dumpops dumpops = { .priv = dht_priv_dump, + .inodectx = dht_inodectx_dump, }; |