Add configure script

Get rid of all the fragile guessing and checking of features,
and roll a configure script instead.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Fix a potential integer overflow

Because nr_files and new_size are not same types.It can cause new_size
less than zero.Then realloc will be failed.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Remove repeated --readonly options in documentation

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add a check avoid segfault

If new_size was zero or realloc failed, it would be segment fault.
So add a check.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup: limit rand map to the actual IO size, if needed

No need allocating a larger map than we need.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
lfsr: ensure we don't generate an offset + buflen that exceeds the max size

Currently we check for the max value, but that doesn't always
work since it may not fit the minimum block size (even if it
is guaranteed to be smaller than the max offset). Pass in the
last valid block.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Pre-load and sort random blocks for pure read verify workloads

If fio is run with a write phase before a read phase and the
IO type is random, the end read verify phase will get sorted
blocks to read back. But if fio is asked to verify something
that was previously randomly written, it will generate the
same random offsets in random order and verify those. This is
usually much slower than a sorted read back.

So add a verifysort_nr option that allows the user to specify
a number of random offsets to pre-generate and sort, before
reading them and verifying the contents. This greatly speeds
up pure read verify workloads.

Default to 1024, and put a max of 64K entries on the option.
We do a merge list sort on the entries, so we don't want a
huge amount of backlog.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure: enable e4defrag engine regardless of MOVE_EXTENT compile test

It may exist in the running kernel, even if the defines
and structures haven't bubbled back into userspace yet.
The engine carries it's own check and structure define
for that case.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Improve documentation for end_fsync

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add CONFIG_64BIT_LLP64, CONFIG_POSIX_FALLOCATE and CONFIG_LINUX_FALLOCATE to Makefile.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Fix configure script for 64-bit Windows.

Hard-code config options when building using MinGW-w64 on Windows.
For 32-bit builds, CC and CONFIG_32BIT/CONFIG_64BIT will need to be
updated manually.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Fix typo (READ/DDIR_READ).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
configure: use exit 0 instead of just exit

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fusion-aw: fixes

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fusion-aw: make configure and compile actually work

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Make hugetlbfs maping work

If it's a file mapping, flags must be MAP_HARED; If it's an anonymous
mapping, flags must be MAP_PRIVATE|MAP_ANONYMOUS|MAP_HUGETLB (can be
shared, but doesn't matter here).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Windows: fix off-by-one error in fio_cpu_set and add affinity error messages.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
Add info log on whether tsc is reliable or not for --cpuclock-test

Signed-off-by: Jens Axboe <axboe@kernel.dk>
gettime: use proper uint64_t types where needed

Windows has 32-bit longs even on 64-bit, so we risk overflowing.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
lfsr: add lfsr_reset()

This enables us to restart a sequence.

Signed-off-by: Jens Axboe <axboe@kernel.dk>