projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make kb_base apply to parser k/m/g etc values
[fio.git]
/
parse.c
diff --git
a/parse.c
b/parse.c
index 29f444b40ba1d6589a2d1a9813ab0bfb058d73f1..0bf28a5bd72463d574560d828859669b9b0122c2 100644
(file)
--- a/
parse.c
+++ b/
parse.c
@@
-14,6
+14,7
@@
#include "debug.h"
static struct fio_option *fio_options;
#include "debug.h"
static struct fio_option *fio_options;
+extern unsigned int fio_kb_base;
static int vp_cmp(const void *p1, const void *p2)
{
static int vp_cmp(const void *p1, const void *p2)
{
@@
-112,24
+113,32
@@
static unsigned long get_mult_time(char c)
}
}
}
}
-static unsigned long get_mult_bytes(char c)
+static unsigned long
long
get_mult_bytes(char c)
{
{
+ unsigned long long ret = 1;
+
switch (c) {
switch (c) {
- case 'k':
- case 'K':
- return 1024;
- case 'm':
- case 'M':
- return 1024 * 1024;
+ default:
+ break;
+ case 'p':
+ case 'P':
+ ret *= (unsigned long long) fio_kb_base;
+ case 't':
+ case 'T':
+ ret *= (unsigned long long) fio_kb_base;
case 'g':
case 'G':
case 'g':
case 'G':
- return 1024 * 1024 * 1024;
- case 'e':
- case 'E':
- return 1024 * 1024 * 1024 * 1024UL;
- default:
- return 1;
+ ret *= (unsigned long long) fio_kb_base;
+ case 'm':
+ case 'M':
+ ret *= (unsigned long long) fio_kb_base;
+ case 'k':
+ case 'K':
+ ret *= (unsigned long long) fio_kb_base;
+ break;
}
}
+
+ return ret;
}
/*
}
/*