summaryrefslogtreecommitdiff
path: root/fio.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2013-04-25 10:11:41 -0600
committerJens Axboe <axboe@kernel.dk>2013-04-25 10:11:41 -0600
commit8d916c942bb088204ab5c0438c297903c9160698 (patch)
treec45409d6aaed0bb3ab50c9b090fe311671226109 /fio.h
parentae3fcb5afb2479f142912e64cad3c271541af5fe (diff)
downloadfio-8d916c942bb088204ab5c0438c297903c9160698.tar.gz
Catch the case where size= is less than the minimum block size
Fio will currently just attempt to start and immediately exit, with no clue as to what went wrong. The behaviour is correct in the sense that there's nothing to output, but it can be a little confusing. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fio.h')
-rw-r--r--fio.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/fio.h b/fio.h
index ebf6309b..5438b768 100644
--- a/fio.h
+++ b/fio.h
@@ -535,6 +535,14 @@ static inline unsigned int td_max_bs(struct thread_data *td)
return max(td->o.max_bs[DDIR_TRIM], max_bs);
}
+static inline unsigned int td_min_bs(struct thread_data *td)
+{
+ unsigned int min_bs;
+
+ min_bs = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
+ return min(td->o.min_bs[DDIR_TRIM], min_bs);
+}
+
static inline int is_power_of_2(unsigned int val)
{
return (val != 0 && ((val & (val - 1)) == 0));