X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=580403dbc232aa8676d2a3933c3eac4a5f7e31a5;hp=accb67acd9a1f1ebd77bcaad8aa366eb4d6e1d5f;hb=fd5d733fa34cb1c2675bce6af7972f6fc12e60d0;hpb=a94aedbc11829470cce77eb52969601d618054d6 diff --git a/filesetup.c b/filesetup.c index accb67ac..580403db 100644 --- a/filesetup.c +++ b/filesetup.c @@ -14,6 +14,7 @@ #include "hash.h" #include "lib/axmap.h" #include "rwlock.h" +#include "zbd.h" #ifdef CONFIG_LINUX_FALLOCATE #include @@ -1142,9 +1143,6 @@ int setup_files(struct thread_data *td) if (err) goto err_out; - if (!o->zone_size) - o->zone_size = o->size; - /* * iolog already set the total io size, if we read back * stored entries. @@ -1161,7 +1159,14 @@ done: 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: @@ -1349,6 +1354,8 @@ void close_and_free_files(struct thread_data *td) td_io_unlink_file(td, f); } + zbd_free_zone_info(f); + if (use_free) free(f->file_name); else @@ -1675,6 +1682,11 @@ int put_file(struct thread_data *td, struct fio_file *f) if (--f->references) return 0; + disk_util_dec(f->du); + + if (td->o.file_lock_mode != FILE_LOCK_NONE) + unlock_file_all(td, f); + if (should_fsync(td) && td->o.fsync_on_close) { f_ret = fsync(f->fd); if (f_ret < 0) @@ -1688,6 +1700,7 @@ int put_file(struct thread_data *td, struct fio_file *f) ret = f_ret; td->nr_open_files--; + fio_file_clear_closing(f); fio_file_clear_open(f); assert(f->fd == -1); return ret; @@ -1867,6 +1880,8 @@ void fio_file_reset(struct thread_data *td, struct fio_file *f) 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)