From: Jens Axboe Date: Tue, 9 Jun 2009 10:48:56 +0000 (+0200) Subject: Merge branch 'master' of ssh://router/data/git/fio X-Git-Tag: fio-1.27.2~5 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=1621031e8a7cbb91afad124da405fc4eabda764f;hp=581e71417760e0aa86eac0acd704253ff0eeea4f Merge branch 'master' of ssh://router/data/git/fio --- diff --git a/filesetup.c b/filesetup.c index c902bdf7..57928133 100644 --- a/filesetup.c +++ b/filesetup.c @@ -132,7 +132,7 @@ static int extend_file(struct thread_data *td, struct fio_file *f) goto err; } } - if (td->o.fill_device) { + if (td->o.fill_device && !td_write(td)) { fio_file_clear_size_known(f); if (td_io_get_file_size(td, f)) goto err; @@ -290,6 +290,9 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, if (off == -1ULL) off = f->file_offset; + if (len == -1ULL || off == -1ULL) + return 0; + dprint(FD_IO, "invalidate cache %s: %llu/%llu\n", f->file_name, off, len); diff --git a/fio.h b/fio.h index 8e4f9dd6..c92629df 100644 --- a/fio.h +++ b/fio.h @@ -413,12 +413,6 @@ extern int fio_gtod_cpu; extern struct thread_data *threads; -#define td_read(td) ((td)->o.td_ddir & TD_DDIR_READ) -#define td_write(td) ((td)->o.td_ddir & TD_DDIR_WRITE) -#define td_rw(td) (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW) -#define td_random(td) ((td)->o.td_ddir & TD_DDIR_RAND) -#define file_randommap(td, f) (!(td)->o.norandommap && (f)->file_map) - static inline void fio_ro_check(struct thread_data *td, struct io_u *io_u) { assert(!(io_u->ddir == DDIR_WRITE && !td_write(td))); diff --git a/init.c b/init.c index 80c329d3..f1f3dba3 100644 --- a/init.c +++ b/init.c @@ -20,7 +20,7 @@ #include "filehash.h" #include "verify.h" -static char fio_version_string[] = "fio 1.27"; +static char fio_version_string[] = "fio 1.27.1"; #define FIO_RANDSEED (0xb1899bedUL) diff --git a/io_ddir.h b/io_ddir.h index 3d9a2050..d2ee40ce 100644 --- a/io_ddir.h +++ b/io_ddir.h @@ -18,4 +18,10 @@ enum td_ddir { TD_DDIR_RANDRW = TD_DDIR_RW | TD_DDIR_RAND, }; +#define td_read(td) ((td)->o.td_ddir & TD_DDIR_READ) +#define td_write(td) ((td)->o.td_ddir & TD_DDIR_WRITE) +#define td_rw(td) (((td)->o.td_ddir & TD_DDIR_RW) == TD_DDIR_RW) +#define td_random(td) ((td)->o.td_ddir & TD_DDIR_RAND) +#define file_randommap(td, f) (!(td)->o.norandommap && (f)->file_map) + #endif