#include "hash.h"
#include "lib/axmap.h"
#include "rwlock.h"
+#include "zbd.h"
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
{
unsigned long long ret, sized;
uint64_t frand_max;
- unsigned long r;
+ uint64_t r;
frand_max = rand_max(&td->file_size_state);
r = __rand(&td->file_size_state);
old_state = td_bump_runstate(td, TD_SETTING_UP);
- if (o->read_iolog_file)
- goto done;
-
/*
* Find out physical size of files or devices for this thread,
* before we determine I/O size and range of our targets.
if (err)
goto err_out;
+ if (o->read_iolog_file)
+ goto done;
+
/*
* check sizes. if the files/devices do not exist and the size
* isn't passed to fio, abort.
td->done = 1;
td_restore_runstate(td, old_state);
+
+ if (td->o.zone_mode == ZONE_MODE_ZBD) {
+ err = zbd_init(td);
+ if (err)
+ goto err_out;
+ }
return 0;
+
err_offset:
log_err("%s: you need to specify valid offset=\n", o->name);
err_out:
static void __init_rand_distribution(struct thread_data *td, struct fio_file *f)
{
unsigned int range_size, seed;
- unsigned long nranges;
+ uint64_t nranges;
uint64_t fsize;
range_size = min(td->o.min_bs[DDIR_READ], td->o.min_bs[DDIR_WRITE]);
fsize = min(f->real_file_size, f->io_size);
- nranges = (fsize + range_size - 1) / range_size;
+ nranges = (fsize + range_size - 1ULL) / range_size;
seed = jhash(f->file_name, strlen(f->file_name), 0) * td->thread_number;
if (!td->o.rand_repeatable)
return false;
if (td->o.random_generator == FIO_RAND_GEN_LFSR) {
- unsigned long seed;
+ uint64_t seed;
seed = td->rand_seeds[FIO_RAND_BLOCK_OFF];
td_io_unlink_file(td, f);
}
+ zbd_free_zone_info(f);
+
if (use_free)
free(f->file_name);
else
axmap_reset(f->io_axmap);
else if (fio_file_lfsr(f))
lfsr_reset(&f->lfsr, td->rand_seeds[FIO_RAND_BLOCK_OFF]);
+
+ zbd_file_reset(td, f);
}
bool fio_files_done(struct thread_data *td)