summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2009-09-15 04:46:44 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-09-16 07:11:33 -0700
commitdcfc4bdd5962ad18665d9ad3f3309884c941845e (patch)
tree85fa786eab575ed48fbd50db9f0613cf9150dde3 /xlators/protocol
parent5480b6eca96a8da4b159783a19f2ed5c2f640769 (diff)
Changed prototype for inode_table_dump() and inode_dump().
Changed prototype for inode_table_dump() and inode_dump() Added support for dumpop inode in mount/fuse and protocol/server 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/protocol')
-rw-r--r--xlators/protocol/server/src/server-protocol.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c
index 9306a9232bd..e7660d245a2 100644
--- a/xlators/protocol/server/src/server-protocol.c
+++ b/xlators/protocol/server/src/server-protocol.c
@@ -7590,8 +7590,46 @@ server_priv (xlator_t *this)
int
server_inode (xlator_t *this)
{
- return 0;
+ server_conf_t *conf = NULL;
+ server_connection_t *trav = NULL;
+ char key[GF_DUMP_MAX_BUF_LEN];
+ int i = 1;
+ int ret = -1;
+
+ if (!this)
+ return -1;
+
+ conf = this->private;
+ if (!conf) {
+ gf_log (this->name, GF_LOG_WARNING,
+ "conf null in xlator");
+ return -1;
+ }
+
+ ret = pthread_mutex_trylock (&conf->mutex);
+ if (ret) {
+ gf_log("", GF_LOG_WARNING, "Unable to dump itable"
+ " errno: %d", errno);
+ return -1;
+ }
+
+ list_for_each_entry (trav, &conf->conns, list) {
+ if (trav->bound_xl && trav->bound_xl->itable) {
+ gf_proc_dump_build_key(key,
+ "xlator.protocol.server.conn",
+ "%d.bound_xl.%s",
+ i, trav->bound_xl->name);
+ inode_table_dump(trav->bound_xl->itable,key);
+ i++;
+ }
+ }
+ pthread_mutex_unlock (&conf->mutex);
+
+
+ return 0;
}
+
+
static void
get_auth_types (dict_t *this, char *key, data_t *value, void *data)
{