engines/filecreate: don't use file hash
authorJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 16:10:39 +0000 (10:10 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Oct 2017 16:12:51 +0000 (10:12 -0600)
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>
engines/filecreate.c

index e078f067fb51e572c80406d0ad2b70f4ac0ad23a..171dcc95b025d9331d9158a57acde012e482737e 100644 (file)
@@ -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;