Increment open file count manually
authorJens Axboe <axboe@fb.com>
Wed, 9 Apr 2014 03:07:12 +0000 (21:07 -0600)
committerJens Axboe <axboe@fb.com>
Wed, 9 Apr 2014 03:07:12 +0000 (21:07 -0600)
For engines/logs that manually add files, be sure to increment
the open file count.

Signed-off-by: Jens Axboe <axboe@fb.com>
blktrace.c
engines/net.c
engines/rbd.c

index 649cb83e702654c5d2f9267b3b992469b718a183..52f0c719eab154fb81bbf2ce405018564bdde748 100644 (file)
@@ -217,6 +217,7 @@ static int trace_add_file(struct thread_data *td, __u32 device)
 
                dprint(FD_BLKTRACE, "add devices %s\n", dev);
                fileno = add_file_exclusive(td, dev);
+               td->o.open_files++;
                td->files[fileno]->major = maj;
                td->files[fileno]->minor = min;
                trace_add_open_close_event(td, fileno, FIO_LOG_OPEN_FILE);
index 110e158f114cbe210656476ff81af305d7d80248..fcf4b8984cd612d1a25d849f2e295ba3935222cf 100644 (file)
@@ -1196,6 +1196,7 @@ static int fio_netio_setup(struct thread_data *td)
        if (!td->files_index) {
                add_file(td, td->o.filename ?: "net", 0, 0);
                td->o.nr_files = td->o.nr_files ?: 1;
+               td->o.open_files++;
        }
 
        if (!td->io_ops->data) {
index 9d64efd233cab1dfd4188f8ada16351d649c8f5e..ff35373795af68eaf357043851c6fe2c1c550fab 100644 (file)
@@ -379,6 +379,7 @@ static int fio_rbd_setup(struct thread_data *td)
        if (!td->files_index) {
                add_file(td, td->o.filename ? : "rbd", 0, 0);
                td->o.nr_files = td->o.nr_files ? : 1;
+               td->o.open_files++;
        }
        f = td->files[0];
        f->real_file_size = info.size;