We just care about the file open latencies, so pointless to
utilize the hash as regular engines do.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
static int open_file(struct thread_data *td, struct fio_file *f)
{
struct timespec start, end;
static int open_file(struct thread_data *td, struct fio_file *f)
{
struct timespec start, end;
int do_lat = !td->o.disable_lat;
dprint(FD_FILE, "fd open %s\n", f->file_name);
int do_lat = !td->o.disable_lat;
dprint(FD_FILE, "fd open %s\n", f->file_name);
if (do_lat)
fio_gettime(&start, NULL);
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];
if (f->fd == -1) {
char buf[FIO_VERROR_SIZE];
snprintf(buf, sizeof(buf), "open(%s)", f->file_name);
td_verror(td, e, buf);
snprintf(buf, sizeof(buf), "open(%s)", f->file_name);
td_verror(td, e, buf);
- 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);