cluster: RHEL56 - gfs_controld: Add extended information to 'group_tool dump plocks' (gfs)
Abhijith Das
adas at fedoraproject.org
Thu Jul 22 15:49:06 UTC 2010
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=06bcbf23e42365e420c1db891defae110c841f0d
Commit: 06bcbf23e42365e420c1db891defae110c841f0d
Parent: f3e58e0c10917cf9b0c214f4ac1332625a30f680
Author: Abhijith Das <adas at redhat.com>
AuthorDate: Thu Jul 22 10:43:32 2010 -0500
Committer: Abhijith Das <adas at redhat.com>
CommitterDate: Thu Jul 22 10:43:32 2010 -0500
gfs_controld: Add extended information to 'group_tool dump plocks' (gfs)
The existing 'group_tool dump plocks' output doesn't include information about
unused and pending plocks. This patch adds this information to the output of
'group_tool dump plocks'.
Signed-off-by: Abhi Das <adas at redhat.com>
Resolves: rhbz#514264
---
group/gfs_controld/plock.c | 56 +++++++++++++++++++++++++++++++++-----------
1 files changed, 42 insertions(+), 14 deletions(-)
diff --git a/group/gfs_controld/plock.c b/group/gfs_controld/plock.c
index b03e77f..a51a1fa 100644
--- a/group/gfs_controld/plock.c
+++ b/group/gfs_controld/plock.c
@@ -2361,6 +2361,7 @@ int dump_plocks(char *name, int fd)
struct posix_lock *po;
struct lock_waiter *w;
struct resource *r;
+ struct timeval now;
char line[MAXLINE];
int rv;
@@ -2371,29 +2372,56 @@ int dump_plocks(char *name, int fd)
if (!mg)
return -1;
+ gettimeofday(&now, NULL);
+
list_for_each_entry(r, &mg->resources, list) {
+ if (list_empty(&r->locks) &&
+ list_empty(&r->waiters) &&
+ list_empty(&r->pending)) {
+ snprintf(line, MAXLINE,
+ "%llu rown %d unused_ms %llu\n",
+ (unsigned long long)r->number, r->owner,
+ (unsigned long long)time_diff_ms(&r->last_access,
+ &now));
+
+ rv = do_write(fd, line, strlen(line));
+ }
+
list_for_each_entry(po, &r->locks, list) {
snprintf(line, MAXLINE,
- "%llu %s %llu-%llu nodeid %d pid %u owner %llx\n",
- (unsigned long long)r->number,
- po->ex ? "WR" : "RD",
- (unsigned long long)po->start,
- (unsigned long long)po->end,
- po->nodeid, po->pid,
- (unsigned long long)po->owner);
+ "%llu %s %llu-%llu nodeid %d pid %u owner %llx rown %d\n",
+ (unsigned long long)r->number,
+ po->ex ? "WR" : "RD",
+ (unsigned long long)po->start,
+ (unsigned long long)po->end,
+ po->nodeid, po->pid,
+ (unsigned long long)po->owner, r->owner);
rv = do_write(fd, line, strlen(line));
}
list_for_each_entry(w, &r->waiters, list) {
snprintf(line, MAXLINE,
- "%llu WAITING %s %llu-%llu nodeid %d pid %u owner %llx\n",
- (unsigned long long)r->number,
- w->info.ex ? "WR" : "RD",
- (unsigned long long)w->info.start,
- (unsigned long long)w->info.end,
- w->info.nodeid, w->info.pid,
- (unsigned long long)w->info.owner);
+ "%llu %s %llu-%llu nodeid %d pid %u owner %llx rown %d WAITING\n",
+ (unsigned long long)r->number,
+ w->info.ex ? "WR" : "RD",
+ (unsigned long long)w->info.start,
+ (unsigned long long)w->info.end,
+ w->info.nodeid, w->info.pid,
+ (unsigned long long)w->info.owner, r->owner);
+
+ rv = do_write(fd, line, strlen(line));
+ }
+
+ list_for_each_entry(w, &r->pending, list) {
+ snprintf(line, MAXLINE,
+ "%llu %s %llu-%llu nodeid %d pid %u owner %llx rown %d PENDING\n",
+ (unsigned long long)r->number,
+ w->info.ex ? "WR" : "RD",
+ (unsigned long long)w->info.start,
+ (unsigned long long)w->info.end,
+ w->info.nodeid, w->info.pid,
+ (unsigned long long)w->info.owner, r->owner);
rv = do_write(fd, line, strlen(line));
}
More information about the cluster-commits
mailing list