Since TD_DDIR_READ is 1, TD_DDIR_WRITE is 1<<1, and td_rw() requires
both TD_DDIR_READ/WRITE bits set, testing (td_read(td) || td_rw(td))
turns out to be
if td_read(td) is false, td_rw(td) is always false,
if td_read(td) is true, td_rw(td) won't be tested,
thus the result equals that of td_read(td).
It's the same for td_write(td) as well.
Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
- if (td->o.verify_only && (td_write(td) || td_rw(td)))
+ if (td->o.verify_only && td_write(td))
verify_bytes = do_dry_run(td);
else {
uint64_t bytes_done[DDIR_RWDIR_CNT];
verify_bytes = do_dry_run(td);
else {
uint64_t bytes_done[DDIR_RWDIR_CNT];
{
if (td->last_was_sync)
return 0;
{
if (td->last_was_sync)
return 0;
- if (td_write(td) || td_rw(td) || td->o.override_sync)
+ if (td_write(td) || td->o.override_sync)
/*
* Reads can do overwrites, we always need to pre-create the file
*/
/*
* Reads can do overwrites, we always need to pre-create the file
*/
- if (td_read(td) || td_rw(td))
o->overwrite = 1;
if (!o->min_bs[DDIR_READ])
o->overwrite = 1;
if (!o->min_bs[DDIR_READ])
* state of numberio, that would have been written to each block
* in a previous run of fio, has been reached.
*/
* state of numberio, that would have been written to each block
* in a previous run of fio, has been reached.
*/
- if ((td_write(td) || td_rw(td)) && (td_min_bs(td) == td_max_bs(td)) &&
+ if (td_write(td) && (td_min_bs(td) == td_max_bs(td)) &&
!td->o.time_based)
if (!td->o.verify_only || td->o.loops == 0)
if (hdr->numberio != io_u->numberio) {
!td->o.time_based)
if (!td->o.verify_only || td->o.loops == 0)
if (hdr->numberio != io_u->numberio) {