projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dedupe_percentage should work even if compress_percentage is not set
[fio.git]
/
trim.c
diff --git
a/trim.c
b/trim.c
index 3da1e749206dc02aaaf633ee25562f3b08c6ee59..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;
@@
-70,15
+70,15
@@
int get_next_trim(struct thread_data *td, struct io_u *io_u)
int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
{
unsigned long long val;
int io_u_should_trim(struct thread_data *td, struct io_u *io_u)
{
unsigned long long val;
- long r;
+
unsigned
long r;
if (!td->o.trim_percentage)
return 0;
if (!td->o.trim_percentage)
return 0;
- r = os_random_long(&td->trim_state);
- val = (OS_RAND_MAX / 100ULL);
- val *= (unsigned long long) td->o.trim_percentage;
+ r = __rand(&td->trim_state);
+ val = (FRAND_MAX / 100ULL);
+ val *= (unsigned long long) td->o.trim_percentage;
return r <= val;
}
#endif
return r <= val;
}
#endif