Adds --test-skip-sequential to disable the sequential hint for the disk cache.

This commit is contained in:
Andrea Mazzoleni 2013-04-04 22:52:56 +02:00
parent a85aa08276
commit aeb167bb16
13 changed files with 114 additions and 65 deletions

View file

@ -81,6 +81,7 @@ void usage(void)
#define OPT_TEST_SKIP_SIGN 260
#define OPT_TEST_SKIP_FALLOCATE 261
#define OPT_TEST_SKIP_DEVICE 262
#define OPT_TEST_SKIP_SEQUENTIAL 263
#if HAVE_GETOPT_LONG
@ -124,8 +125,12 @@ struct option long_options[] = {
/* Skip the fallocate() when growing the parity files */
{ "test-skip-fallocate", 0, 0, OPT_TEST_SKIP_FALLOCATE },
/* Skip the sequential hint when reading files */
{ "test-skip-sequential", 0, 0, OPT_TEST_SKIP_SEQUENTIAL },
/* Skip the device check */
{ "test-skip-device", 0, 0, OPT_TEST_SKIP_DEVICE },
{ 0, 0, 0, 0 }
};
#endif
@ -167,6 +172,7 @@ int main(int argc, char* argv[])
int test_skip_self;
int test_skip_sign;
int test_skip_fallocate;
int test_skip_sequential;
int test_skip_device;
const char* conf;
struct snapraid_state state;
@ -199,6 +205,7 @@ int main(int argc, char* argv[])
test_skip_self = 0;
test_skip_sign = 0;
test_skip_fallocate = 0;
test_skip_sequential = 0;
test_skip_device = 0;
blockstart = 0;
blockcount = 0;
@ -315,6 +322,9 @@ int main(int argc, char* argv[])
case OPT_TEST_SKIP_FALLOCATE :
test_skip_fallocate = 1;
break;
case OPT_TEST_SKIP_SEQUENTIAL :
test_skip_sequential = 1;
break;
case OPT_TEST_SKIP_DEVICE :
test_skip_device = 1;
break;
@ -409,7 +419,7 @@ int main(int argc, char* argv[])
state_init(&state);
state_config(&state, conf, command, verbose, gui, force_zero, force_empty, force_uuid, find_by_name, test_expect_unrecoverable, test_expect_recoverable, test_skip_sign, test_skip_fallocate, test_skip_device);
state_config(&state, conf, command, verbose, gui, force_zero, force_empty, force_uuid, find_by_name, test_expect_unrecoverable, test_expect_recoverable, test_skip_sign, test_skip_fallocate, test_skip_sequential, test_skip_device);
if (import != 0) {
state_import(&state, import);