diff options
author | Raghavendra Bhat <raghavendrabhat@gluster.com> | 2011-09-29 12:11:44 +0530 |
---|---|---|
committer | Vijay Bellur <vijay@gluster.com> | 2011-10-01 05:55:22 -0700 |
commit | 9ef8eabae21a3073f3dc09602d0680d631cbd576 (patch) | |
tree | 8474d6dd21510aad862490586c7e8ca2359b12fd /xlators/features/locks/src | |
parent | 161ab1b9664abf3561902c94b8748e9a95d4867c (diff) |
statedump: do not print the inode number in the statedump
Since gfid is used to uniquely identify a inode, in the statedump
printing inode number is not necessary. Its suffecient if the gfid
of the inode is printed. And do not print the the inodelks, entrylks
and posixlks if the lock count is 0.
Change-Id: Idac115fbce3a5684a0f02f8f5f20b194df8fb27f
BUG: 3476
Reviewed-on: http://review.gluster.com/530
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'xlators/features/locks/src')
-rw-r--r-- | xlators/features/locks/src/posix.c | 68 |
1 files changed, 19 insertions, 49 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 62bdf812dee..2afb3b07fcd 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -1558,7 +1558,7 @@ __dump_entrylks (pl_inode_t *pl_inode) count = 0; gf_proc_dump_build_key(key, - "xlator.feature.locks.lock-dump.domain", + "lock-dump.domain", "domain"); gf_proc_dump_write(key, "%s", dom->domain); @@ -1629,14 +1629,14 @@ __dump_inodelks (pl_inode_t *pl_inode) count = 0; gf_proc_dump_build_key(key, - "xlator.feature.locks.lock-dump.domain", + "lock-dump.domain", "domain"); gf_proc_dump_write(key, "%s", dom->domain); list_for_each_entry (lock, &dom->inodelk_list, list) { gf_proc_dump_build_key(key, - "xlator.feature.locks.lock-dump.domain.inodelk", + "inodelk", "inodelk[%d](ACTIVE)",count ); SET_FLOCK_PID (&lock->user_flock, lock); @@ -1653,7 +1653,7 @@ __dump_inodelks (pl_inode_t *pl_inode) list_for_each_entry (lock, &dom->blocked_inodelks, blocked_locks) { gf_proc_dump_build_key(key, - "xlator.feature.locks.lock-dump.domain.inodelk", + "inodelk", "inodelk[%d](BLOCKED)",count ); SET_FLOCK_PID (&lock->user_flock, lock); pl_dump_lock (tmp, 256, &lock->user_flock, @@ -1693,7 +1693,7 @@ __dump_posixlks (pl_inode_t *pl_inode) SET_FLOCK_PID (&lock->user_flock, lock); gf_proc_dump_build_key(key, - "xlator.feature.locks.lock-dump.domain.posixlk", + "posixlk", "posixlk[%d](%s)", count, lock->blocked ? "BLOCKED" : "ACTIVE"); @@ -1728,7 +1728,6 @@ pl_dump_inode_priv (xlator_t *this, 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]; int count = 0; @@ -1746,61 +1745,32 @@ pl_dump_inode_priv (xlator_t *this, inode_t *inode) goto out; } - gf_proc_dump_build_key(key, - "xlator.feature.locks.inode", - "%ld.mandatory",inode->ino); - gf_proc_dump_write(key, "%d", pl_inode->mandatory); - + gf_proc_dump_add_section("xlator.features.locks.%s.inode", this->name); - count = get_entrylk_count (this, inode); - gf_proc_dump_build_key(key, - "xlator.feature.locks.entrylk-count", - "%ld.entrylk-count", inode->ino); - gf_proc_dump_write(key, "%d", count); + gf_proc_dump_write("mandatory", "%d", pl_inode->mandatory); + count = get_entrylk_count (this, inode); + if (count) { + gf_proc_dump_write("entrylk-count", "%d", count); dump_entrylks(pl_inode); + } - count = get_inodelk_count (this, inode); - gf_proc_dump_build_key(key, - "xlator.feature.locks.inodelk-count", - "%ld.inodelk-count", inode->ino); - gf_proc_dump_write(key, "%d", count); - + count = get_inodelk_count (this, inode); + if (count) { + gf_proc_dump_write("inodlk-count", "%d", count); dump_inodelks(pl_inode); + } - count = get_posixlk_count (this, inode); - gf_proc_dump_build_key(key, - "xlator.feature.locks.posixlk-count", - "%ld.posixlk-count", inode->ino); - gf_proc_dump_write(key, "%d", count); - + count = get_posixlk_count (this, inode); + if (count) { + gf_proc_dump_write("posixlk-count", "%d", count); dump_posixlks(pl_inode); - + } out: return ret; } - - -/* - * pl_dump_inode - inode dump function for posix locks - * - */ -int -pl_dump_inode (xlator_t *this) -{ - - GF_ASSERT (this); - - if (this->itable) { - inode_table_dump(this->itable, - "xlator.features.locks.inode_table"); - } - - return 0; -} - int32_t mem_acct_init (xlator_t *this) { |