diff options
author | Vijay Bellur <vijay@gluster.com> | 2009-08-15 12:58:08 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-08-19 17:57:53 -0700 |
commit | b4d6c3d1bb461d2c8a396c9ed3881a4da40fc6ab (patch) | |
tree | 7a5a15665d46a91b9d4d744b0da599c4628d7f6c /xlators/features/locks | |
parent | a31b0016347b3bc9b341fa0f4541ed137224f593 (diff) |
TAKE2[PATCH BUG:213 1/1] Support for Process State Dump
Support for process state dump.
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/features/locks')
-rw-r--r-- | xlators/features/locks/src/posix.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index d672beaebc3..7389e1e6afd 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -36,6 +36,7 @@ #include "locks.h" #include "common.h" +#include "statedump.h" #ifndef LLONG_MAX #define LLONG_MAX LONG_LONG_MAX /* compat with old gcc */ @@ -768,6 +769,57 @@ pl_forget (xlator_t *this, } +void +pl_dump_inode_priv (inode_t *inode) +{ + + int ret = -1; + uint64_t tmp_pl_inode = 0; + pl_inode_t *pl_inode = NULL; + char key[GF_DUMP_MAX_BUF_LEN]; + + if (!inode) + return; + + ret = inode_ctx_get (inode, inode->table->xl, &tmp_pl_inode); + + if (ret != 0) + return; + + pl_inode = (pl_inode_t *)(long)tmp_pl_inode; + + if (!pl_inode) + return; + + gf_proc_dump_build_key(key, + "xlator.feature.locks.inode", + "%ld.%s",inode->ino, "mandatory"); + gf_proc_dump_write(key, "%d", pl_inode->mandatory); +} + + + +/* + * pl_dump_inode - inode dump function for posix locks + * + */ +int +pl_dump_inode (xlator_t *this) +{ + + assert(this); + + if (this->itable) { + inode_table_dump(this->itable, + "xlator.features.locks.inode_table", + pl_dump_inode_priv); + } + + return 0; +} + + + int init (xlator_t *this) { @@ -864,6 +916,9 @@ struct xlator_fops fops = { struct xlator_mops mops = { }; +struct xlator_dumpops dumpops = { + .inode = pl_dump_inode, +}; struct xlator_cbks cbks = { .forget = pl_forget, |