From: Jens Axboe Date: Mon, 9 Oct 2017 16:10:39 +0000 (-0600) Subject: engines/filecreate: don't use file hash X-Git-Tag: fio-3.2~58 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=52582166d723870f68e7f4ff7532de13b3cdeaea;p=fio.git engines/filecreate: don't use file hash We just care about the file open latencies, so pointless to utilize the hash as regular engines do. Signed-off-by: Jens Axboe --- diff --git a/engines/filecreate.c b/engines/filecreate.c index e078f067..171dcc95 100644 --- a/engines/filecreate.c +++ b/engines/filecreate.c @@ -15,7 +15,6 @@ static int open_file(struct thread_data *td, struct fio_file *f) { struct timespec start, end; - int from_hash = 0; int do_lat = !td->o.disable_lat; dprint(FD_FILE, "fd open %s\n", f->file_name); @@ -29,17 +28,10 @@ static int open_file(struct thread_data *td, struct fio_file *f) return 1; } -open_again: if (do_lat) fio_gettime(&start, NULL); - from_hash = file_lookup_open(f, O_CREAT|O_RDWR); - if (do_lat) { - unsigned long long nsec; - fio_gettime(&end, NULL); - nsec = ntime_since(&start, &end); - add_lat_sample(td, DDIR_WRITE, nsec, 0, 0); - } + f->fd = open(f->file_name, O_CREAT|O_RDWR, 0600); if (f->fd == -1) { char buf[FIO_VERROR_SIZE]; @@ -47,18 +39,15 @@ open_again: snprintf(buf, sizeof(buf), "open(%s)", f->file_name); td_verror(td, e, buf); + return 1; } - if (!from_hash && f->fd != -1) { - if (add_file_hash(f)) { - int fio_unused ret; + if (do_lat) { + unsigned long long nsec; - /* - * OK to ignore, we haven't done anything with it - */ - ret = generic_close_file(td, f); - goto open_again; - } + fio_gettime(&end, NULL); + nsec = ntime_since(&start, &end); + add_lat_sample(td, DDIR_WRITE, nsec, 0, 0); } return 0;