projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d537c08
)
filesetup: limit rand map to the actual IO size, if needed
author
Jens Axboe
<axboe@kernel.dk>
Fri, 11 Jan 2013 13:03:05 +0000
(14:03 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Fri, 11 Jan 2013 13:03:05 +0000
(14:03 +0100)
No need allocating a larger map than we need.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c
patch
|
blob
|
blame
|
history
diff --git
a/filesetup.c
b/filesetup.c
index ab5cc48da71ddb317bab84109eb1845b9a7818e5..478bda8cb0331017b55574d8df67c09cd1151bed 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-956,7
+956,9
@@
int init_random_map(struct thread_data *td)
return 0;
for_each_file(td, f, i) {
- blocks = (f->real_file_size + td->o.rw_min_bs - 1) /
+ uint64_t file_size = min(f->real_file_size, f->io_size);
+
+ blocks = (file_size + td->o.rw_min_bs - 1) /
(unsigned long long) td->o.rw_min_bs;
if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
unsigned long seed;