Add fill_device option.

From: Shawn Lewis <shawnlewis_at_google.com>
Date: Thu, 10 Jan 2008 20:27:09 -0800 (PST)

Add fill_device option. Causes fio to write until ENOSPC occurs (assuming
rw=write).

diff --git a/HOWTO b/HOWTO
index 29a0fd2..878bcf0 100644
--- a/HOWTO
+++ b/HOWTO
@@ -262,6 +262,10 @@ filesize=siint Individual file sizes. Ma
                 and limited to 'size' in total (if that is given). If not
                 given, each created file is the same size.
 
+fill_device=bool Sets size to something really large and waits for ENOSPC (no
+ space left on device) as the terminating condition. Only makes
+ sense with sequential write.
+
 blocksize=siint
 bs=siint The block size used for the io units. Defaults to 4k. Values
                 can be given for both read and writes. If a single siint is
diff --git a/filesetup.c b/filesetup.c
index 134ee1a..94a3a6c 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -378,7 +378,7 @@ int setup_files(struct thread_data *td)
          * device/file sizes are zero and no size given, punt
          */
         if ((!total_size || total_size == -1ULL) && !td->o.size &&
- !(td->io_ops->flags & FIO_NOIO)) {
+ !(td->io_ops->flags & FIO_NOIO) && !td->o.fill_device) {
                 log_err("%s: you need to specify size=\n", td->o.name);
                 td_verror(td, EINVAL, "total_file_size");
                 return 1;
diff --git a/fio.c b/fio.c
index e9b27d9..1c79d68 100644
--- a/fio.c
+++ b/fio.c
@@ -568,6 +568,10 @@ sync_done:
                 }
         }
 
+ if (td->o.fill_device && td->error == ENOSPC) {
+ td->error = 0;
+ td->terminate = 1;
+ }
         if (!td->error) {
                 struct fio_file *f;
 
diff --git a/fio.h b/fio.h
index 16b0111..39e9c7a 100644
--- a/fio.h
+++ b/fio.h
@@ -402,6 +402,7 @@ struct thread_options {
         unsigned int iodepth_batch;
 
         unsigned long long size;
+ unsigned int fill_device;
         unsigned long long file_size_low;
         unsigned long long file_size_high;
         unsigned long long start_offset;
diff --git a/init.c b/init.c
index c56a3c0..8fee63c 100644
--- a/init.c
+++ b/init.c
@@ -293,6 +293,9 @@ static int fixup_options(struct thread_d
                 o->time_based = 0;
         }
 
+ if (o->fill_device && !o->size)
+ o->size = ULONG_LONG_MAX;
+
         return 0;
 }
 
diff --git a/options.c b/options.c
index 136d2e6..2843715 100644
--- a/options.c
+++ b/options.c
@@ -405,6 +405,13 @@ #endif
                 .help = "Total size of device or files",
         },
         {
+ .name = "fill_device",
+ .type = FIO_OPT_BOOL,
+ .off1 = td_var_offset(fill_device),
+ .help = "Write until an ENOSPC error occurs",
+ .def = "0",
+ },
+ {
                 .name = "filesize",
                 .type = FIO_OPT_STR_VAL,
                 .off1 = td_var_offset(file_size_low),
Received on Fri Jan 11 2008 - 05:27:09 CET

This archive was generated by hypermail 2.2.0 : Fri Jan 11 2008 - 05:30:03 CET