mirror of
https://github.com/samba-team/samba.git
synced 2025-01-26 10:04:02 +03:00
added -M option for minimum lock size
(This used to be commit 6acd98cbb92ec5c78686d23d2e05c1c98b5127fe)
This commit is contained in:
parent
ced46b906b
commit
7f35a045fc
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user