X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=356580e74c1276ccde5af550116e3bfd6813321b;hp=11138b7a5cddc662f0b872819ecc812d40361196;hb=413dd459a7710ba421061e840dd9ac3161c70f20;hpb=0aabe160c38efc3c42157fac2a9af08e070341c6 diff --git a/filesetup.c b/filesetup.c index 11138b7a..356580e7 100644 --- a/filesetup.c +++ b/filesetup.c @@ -113,8 +113,7 @@ static int create_files(struct thread_data *td) for_each_file(td, f, i) { int file_there = !file_ok(td, f); - if (file_there && td->ddir == DDIR_WRITE && - !td->overwrite) { + if (file_there && td_write(td) && !td->overwrite) { unlink(f->file_name); file_there = 0; } @@ -279,7 +278,7 @@ static int __setup_file_mmap(struct thread_data *td, struct fio_file *f) if (td->invalidate_cache && file_invalidate_cache(td, f)) return 1; - if (td->sequential) { + if (!td_random(td)) { if (madvise(f->mmap, f->file_size, MADV_SEQUENTIAL) < 0) { td_verror(td, errno, "madvise"); return 1; @@ -313,7 +312,7 @@ static int __setup_file_plain(struct thread_data *td, struct fio_file *f) if (td->invalidate_cache && file_invalidate_cache(td, f)) return 1; - if (td->sequential) { + if (!td_random(td)) { if (fadvise(f->fd, f->file_offset, f->file_size, POSIX_FADV_SEQUENTIAL) < 0) { td_verror(td, errno, "fadvise"); return 1;