summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-03-05 19:51:37 +0000
committerAndrew Tridgell <tridge@samba.org>2002-03-05 19:51:37 +0000
commit7f35a045fc8fc289830cf27180ca5b833cbb3c9b (patch)
tree6124c56b6e008bead46227d3c4ff91d2ab002453
parentced46b906b40b6c4e201894cfeb7b43fe1e33dc2 (diff)
downloadsamba-7f35a045fc8fc289830cf27180ca5b833cbb3c9b.tar.gz
samba-7f35a045fc8fc289830cf27180ca5b833cbb3c9b.tar.bz2
samba-7f35a045fc8fc289830cf27180ca5b833cbb3c9b.zip
added -M option for minimum lock size
(This used to be commit 6acd98cbb92ec5c78686d23d2e05c1c98b5127fe)
-rw-r--r--source3/torture/locktest.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/torture/locktest.c b/source3/torture/locktest.c
index 2f7c4a9c05..47be83e97f 100644
--- a/source3/torture/locktest.c
+++ b/source3/torture/locktest.c
@@ -33,11 +33,11 @@ static BOOL hide_unlock_fails;
static BOOL use_oplocks;
static unsigned lock_range = 100;
static unsigned lock_base = 0;
+static unsigned min_length = 0;
#define FILENAME "\\locktest.dat"
-#define MINLENGTH 0
-#define ZERO_ZERO 1
+#define ZERO_ZERO 0
#define READ_PCT 50
#define LOCK_PCT 45
@@ -413,7 +413,7 @@ static void test_locks(char *share[NSERVERS])
recorded[n].conn = random() % NCONNECTIONS;
recorded[n].f = random() % NFILES;
recorded[n].start = lock_base + ((unsigned)random() % (lock_range-1));
- recorded[n].len = MINLENGTH +
+ recorded[n].len = min_length +
random() % (lock_range-(recorded[n].start-lock_base));
recorded[n].start *= RANGE_MULTIPLE;
recorded[n].len *= RANGE_MULTIPLE;
@@ -533,6 +533,7 @@ static void usage(void)
-O use oplocks\n\
-R range set lock range\n\
-B base set lock base\n\
+ -M min set min lock length\n\
");
}
@@ -576,7 +577,7 @@ static void usage(void)
seed = time(NULL);
- while ((opt = getopt(argc, argv, "U:s:ho:aAW:OkR:B:")) != EOF) {
+ while ((opt = getopt(argc, argv, "U:s:ho:aAW:OkR:B:M:")) != EOF) {
switch (opt) {
case 'k':
#ifdef HAVE_KRB5
@@ -602,6 +603,9 @@ static void usage(void)
case 'B':
lock_base = strtol(optarg, NULL, 0);
break;
+ case 'M':
+ min_length = strtol(optarg, NULL, 0);
+ break;
case 's':
seed = atoi(optarg);
break;