static unsigned long get_mult_time(char c)
{
switch (c) {
- case 'm':
- case 'M':
- return 60;
- case 'h':
- case 'H':
- return 60 * 60;
- case 'd':
- case 'D':
- return 24 * 60 * 60;
- default:
- return 1;
+ case 'm':
+ case 'M':
+ return 60;
+ case 'h':
+ case 'H':
+ return 60 * 60;
+ case 'd':
+ case 'D':
+ return 24 * 60 * 60;
+ default:
+ return 1;
}
}
static unsigned long get_mult_bytes(char c)
{
switch (c) {
- case 'k':
- case 'K':
- return 1024;
- case 'm':
- case 'M':
- return 1024 * 1024;
- case 'g':
- case 'G':
- return 1024 * 1024 * 1024;
- case 'e':
- case 'E':
- return 1024 * 1024 * 1024 * 1024UL;
- default:
- return 1;
+ case 'k':
+ case 'K':
+ return 1024;
+ case 'm':
+ case 'M':
+ return 1024 * 1024;
+ case 'g':
+ case 'G':
+ return 1024 * 1024 * 1024;
+ case 'e':
+ case 'E':
+ return 1024 * 1024 * 1024 * 1024UL;
+ default:
+ return 1;
}
}
break;
if (o->maxval && ull > o->maxval) {
- fprintf(stderr, "max value out of range: %lld (%d max)\n", ull, o->maxval);
+ fprintf(stderr, "max value out of range: %lld"
+ " (%d max)\n", ull, o->maxval);
return 1;
}
if (o->minval && ull < o->minval) {
- fprintf(stderr, "min value out of range: %lld (%d min)\n", ull, o->minval);
+ fprintf(stderr, "min value out of range: %lld"
+ " (%d min)\n", ull, o->minval);
return 1;
}
p1 = tmp;
ret = 1;
- if (!check_range_bytes(p1, &ul1) && !check_range_bytes(p2, &ul2)) {
+ if (!check_range_bytes(p1, &ul1) &&
+ !check_range_bytes(p2, &ul2)) {
ret = 0;
if (ul1 > ul2) {
unsigned long foo = ul1;
break;
if (o->maxval && il > (int) o->maxval) {
- fprintf(stderr, "max value out of range: %d (%d max)\n", il, o->maxval);
+ fprintf(stderr, "max value out of range: %d (%d max)\n",
+ il, o->maxval);
return 1;
}
if (o->minval && il < o->minval) {
- fprintf(stderr, "min value out of range: %d (%d min)\n", il, o->minval);
+ fprintf(stderr, "min value out of range: %d (%d min)\n",
+ il, o->minval);
return 1;
}
}
break;
}
+ case FIO_OPT_DEPRECATED:
+ fprintf(stdout, "Option %s is deprecated\n", o->name);
+ break;
default:
fprintf(stderr, "Bad option type %u\n", o->type);
ret = 1;
return;
if (!org)
org = o;
-
+
p = name;
depth = level;
while (depth--)
for (o = &options[0]; o->name; o++) {
int match = 0;
+ if (o->type == FIO_OPT_DEPRECATED)
+ continue;
+
if (name) {
if (!strcmp(name, o->name) ||
(o->alias && !strcmp(name, o->alias)))
dprint(FD_PARSE, "init options\n");
for (o = &options[0]; o->name; o++) {
+ if (o->type == FIO_OPT_DEPRECATED)
+ continue;
if (o->type == FIO_OPT_BOOL) {
o->minval = 0;
o->maxval = 1;
}
- if (o->type == FIO_OPT_STR_SET && o->def)
- fprintf(stderr, "Option %s: string set option with default will always be true\n", o->name);
- if (!o->cb && !o->off1)
- fprintf(stderr, "Option %s: neither cb nor offset given\n", o->name);
+ if (o->type == FIO_OPT_STR_SET && o->def) {
+ fprintf(stderr, "Option %s: string set option with"
+ " default will always be true\n",
+ o->name);
+ }
+ if (!o->cb && !o->off1) {
+ fprintf(stderr, "Option %s: neither cb nor offset"
+ " given\n", o->name);
+ }
if (o->type == FIO_OPT_STR || o->type == FIO_OPT_STR_STORE)
continue;
- if (o->cb && (o->off1 || o->off2 || o->off3 || o->off4))
- fprintf(stderr, "Option %s: both cb and offset given\n", o->name);
+ if (o->cb && (o->off1 || o->off2 || o->off3 || o->off4)) {
+ fprintf(stderr, "Option %s: both cb and offset given\n",
+ o->name);
+ }
}
}