Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1467,7 +1467,10 @@ int init_io_u_buffers(struct thread_data *td)
char *p;

max_units = td->o.iodepth;
max_bs = td_max_bs(td);
if (td->trim_verify && td->o.trim_zero)
max_bs = td_max_bs(td);
else
max_bs = td_max_rw_bs(td);
min_write = td->o.min_bs[DDIR_WRITE];
td->orig_buffer_size = (unsigned long long) max_bs
* (unsigned long long) max_units;
Expand Down
8 changes: 8 additions & 0 deletions fio.h
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,14 @@ static inline bool should_check_rate(struct thread_data *td)
return (td->flags & TD_F_CHECK_RATE) != 0;
}

/*
* This function considers only read and write block sizes.
*/
static inline unsigned long long td_max_rw_bs(struct thread_data *td)
{
return max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
}

static inline unsigned long long td_max_bs(struct thread_data *td)
{
unsigned long long max_bs;
Expand Down