X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=94a025e6c1064e442dc18254d08e3f002dcae644;hp=a2427a1a80bb0bea52aeee2cab761faac09a5cef;hb=922e390f69c8169a215187ea8ef5aca0deac11b8;hpb=5de1d4ba1e6ae82bb4ad559463801cb6b7096ac3 diff --git a/filesetup.c b/filesetup.c index a2427a1a..94a025e6 100644 --- a/filesetup.c +++ b/filesetup.c @@ -107,7 +107,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) { int new_layout = 0, unlink_file = 0, flags; unsigned long long left; - unsigned int bs; + unsigned long long bs; char *b = NULL; if (read_only) { @@ -260,7 +260,7 @@ static bool pre_read_file(struct thread_data *td, struct fio_file *f) { int r, did_open = 0, old_runstate; unsigned long long left; - unsigned int bs; + unsigned long long bs; bool ret = true; char *b; @@ -900,7 +900,7 @@ int setup_files(struct thread_data *td) unsigned int i, nr_fs_extra = 0; int err = 0, need_extend; int old_state; - const unsigned int bs = td_min_bs(td); + const unsigned long long bs = td_min_bs(td); uint64_t fs = 0; dprint(FD_FILE, "setup files\n"); @@ -1675,6 +1675,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 +1693,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;