projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Include file name in offset failure
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 76ad9335f0f3f14f503476dc11811539be29bc4b..f451d1a756141e3a29eaad8f3f2fb74d113ae82e 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-54,11
+54,8
@@
static void mark_random_map(struct thread_data *td, struct io_u *io_u)
* If we have a mixed random workload, we may
* encounter blocks we already did IO to.
*/
* If we have a mixed random workload, we may
* encounter blocks we already did IO to.
*/
- if ((td->o.ddir_nr == 1) && !random_map_free(f, block)) {
- if (!blocks)
- blocks = 1;
+ if ((td->o.ddir_nr == 1) && !random_map_free(f, block))
break;
break;
- }
idx = RAND_MAP_IDX(f, block);
bit = RAND_MAP_BIT(f, block);
idx = RAND_MAP_IDX(f, block);
bit = RAND_MAP_BIT(f, block);
@@
-69,10
+66,20
@@
static void mark_random_map(struct thread_data *td, struct io_u *io_u)
if (this_blocks + bit > BLOCKS_PER_MAP)
this_blocks = BLOCKS_PER_MAP - bit;
if (this_blocks + bit > BLOCKS_PER_MAP)
this_blocks = BLOCKS_PER_MAP - bit;
- if (this_blocks == BLOCKS_PER_MAP)
- mask = -1U;
- else
- mask = ((1U << this_blocks) - 1) << bit;
+ do {
+ if (this_blocks == BLOCKS_PER_MAP)
+ mask = -1U;
+ else
+ mask = ((1U << this_blocks) - 1) << bit;
+
+ if (!(f->file_map[idx] & mask))
+ break;
+
+ this_blocks--;
+ } while (this_blocks);
+
+ if (!this_blocks)
+ break;
f->file_map[idx] |= mask;
nr_blocks -= this_blocks;
f->file_map[idx] |= mask;
nr_blocks -= this_blocks;
@@
-935,6
+942,8
@@
struct io_u *get_io_u(struct thread_data *td)
} else if (!(td->io_hist_len % td->o.verify_backlog) &&
td->last_ddir != DDIR_READ) {
td->verify_batch = td->o.verify_batch;
} else if (!(td->io_hist_len % td->o.verify_backlog) &&
td->last_ddir != DDIR_READ) {
td->verify_batch = td->o.verify_batch;
+ if (!td->verify_batch)
+ td->verify_batch = td->o.verify_backlog;
get_verify = 1;
}
get_verify = 1;
}