From: teigland@sourceware.org <teigland@sourceware.org>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] cluster/dlm/tests/usertest dlmtest2.c
Date: 8 Dec 2006 19:25:28 -0000 [thread overview]
Message-ID: <20061208192528.26975.qmail@sourceware.org> (raw)
CVSROOT: /cvs/cluster
Module name: cluster
Changes by: teigland at sourceware.org 2006-12-08 19:25:28
Modified files:
dlm/tests/usertest: dlmtest2.c
Log message:
tidy up some prints
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/dlm/tests/usertest/dlmtest2.c.diff?cvsroot=cluster&r1=1.1&r2=1.2
--- cluster/dlm/tests/usertest/dlmtest2.c 2006/12/07 19:50:49 1.1
+++ cluster/dlm/tests/usertest/dlmtest2.c 2006/12/08 19:25:27 1.2
@@ -98,7 +98,7 @@
int i;
for (i = 0; i < LOCKS; i++) {
- printf("i %d lkid %x grmode %d rqmode %d wait_ast %d\n", i,
+ printf("x %d lkid %x grmode %d rqmode %d wait_ast %d\n", i,
locks[i].lksb.sb_lkid,
locks[i].grmode,
locks[i].rqmode,
@@ -159,6 +159,9 @@
int flags = 0;
int rv;
+ if (i < 0 || i >= LOCKS)
+ return;
+
if (noqueue)
flags |= LKF_NOQUEUE;
@@ -189,6 +192,9 @@
int flags = 0;
int rv;
+ if (i < 0 || i >= LOCKS)
+ return;
+
if (noqueue)
flags |= LKF_NOQUEUE;
@@ -233,6 +239,9 @@
uint32_t lkid;
int rv;
+ if (i < 0 || i >= LOCKS)
+ return;
+
lkid = locks[i].lksb.sb_lkid;
if (!lkid) {
printf("unlock %d skip zero lkid\n", i);
@@ -264,6 +273,9 @@
uint32_t lkid;
int rv;
+ if (i < 0 || i >= LOCKS)
+ return;
+
lkid = locks[i].lksb.sb_lkid;
if (!lkid) {
printf("unlock %d skip zero lkid\n", i);
@@ -451,6 +463,7 @@
if (!strncmp(cmd, "help", 4)) {
printf("Usage:\n");
+ printf("MAX locks is %d (x of 0 to %d)\n", LOCKS, LOCKS-1);
printf("EXIT - exit program after unlocking any held locks\n");
printf("kill - exit program without unlocking any locks\n");
printf("lock x mode - request/convert lock on resource x\n");
@@ -465,7 +478,7 @@
printf("release - for x in 0 to MAX, unlock x\n");
printf("dump - show info for all resources\n");
printf("loop x n - lock_sync x PR / unlock_sync x, n times\n");
- printf("hammer n - loop doing random lock/unlock on all locks, n times");
+ printf("hammer n - loop doing random lock/unlock on all locks, n times\n");
printf("noqueue - toggle NOQUEUE flag for all requests\n");
return;
}
@@ -486,6 +499,8 @@
locks[i].rqmode = -1;
}
+ printf("Joining test lockspace...\n");
+
dh = dlm_create_lockspace("test", 0600);
if (!dh) {
printf("dlm_create_lockspace error %d %d\n", (int) dh, errno);
@@ -503,7 +518,7 @@
client_add(libdlm_fd, &maxi);
client_add(STDIN_FILENO, &maxi);
- printf("Type EXIT to finish\n");
+ printf("Type EXIT to finish, help for usage\n");
while (1) {
rv = poll(pollfd, maxi + 1, -1);
next reply other threads:[~2006-12-08 19:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-08 19:25 teigland [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-12-12 21:17 [Cluster-devel] cluster/dlm/tests/usertest dlmtest2.c teigland
2007-01-04 20:34 teigland
2007-02-27 18:55 teigland
2007-03-27 19:04 teigland
2007-04-27 19:09 teigland
2007-05-30 19:31 teigland
2007-08-22 14:01 teigland
2007-08-23 19:13 teigland
2008-01-17 21:49 teigland
2008-02-21 17:49 teigland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061208192528.26975.qmail@sourceware.org \
--to=teigland@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).