projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gluster: io_u->error should be a positive error value
[fio.git]
/
trim.c
diff --git
a/trim.c
b/trim.c
index de792dc46fd499beed43baffcc9b68184b04cf13..95c433b7c006aa0817357bd6d4b2d94d0d4b68fb 100644
(file)
--- a/
trim.c
+++ b/
trim.c
@@
-24,7
+24,7
@@
int get_next_trim(struct thread_data *td, struct io_u *io_u)
return 1;
assert(td->trim_entries);
return 1;
assert(td->trim_entries);
- ipo = flist_
entry(td->trim_list.nex
t, struct io_piece, trim_list);
+ ipo = flist_
first_entry(&td->trim_lis
t, struct io_piece, trim_list);
remove_trim_entry(td, ipo);
io_u->offset = ipo->offset;
remove_trim_entry(td, ipo);
io_u->offset = ipo->offset;
@@
-75,13
+75,8
@@
int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
if (!td->o.trim_percentage)
return 0;
if (!td->o.trim_percentage)
return 0;
- if (td->o.use_os_rand) {
- r = os_random_long(&td->trim_state);
- val = (OS_RAND_MAX / 100ULL);
- } else {
- r = __rand(&td->__trim_state);
- val = (FRAND_MAX / 100ULL);
- }
+ r = __rand(&td->trim_state);
+ val = (FRAND_MAX / 100ULL);
val *= (unsigned long long) td->o.trim_percentage;
return r <= val;
val *= (unsigned long long) td->o.trim_percentage;
return r <= val;