X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=75694bd81825082516d9f1601de08a650ebe9aa1;hp=c115f7b16863a88f411427a424be06f3f558e56a;hb=56c77c10f79d7be492aa0fb137786978c3596682;hpb=ec2ea18e87fad6c42d6875cd4ee1bb25ef9b4627 diff --git a/filesetup.c b/filesetup.c index c115f7b1..75694bd8 100644 --- a/filesetup.c +++ b/filesetup.c @@ -490,7 +490,6 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, } else if (td_ioengine_flagged(td, FIO_DISKLESSIO)) { dprint(FD_IO, "invalidate not supported by ioengine %s\n", td->io_ops->name); - ret = 0; } else if (f->filetype == FIO_TYPE_FILE) { dprint(FD_IO, "declare unneeded cache %s: %llu/%llu\n", f->file_name, off, len); @@ -517,14 +516,12 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f, log_err("fio: only root may flush block " "devices. Cache flush bypassed!\n"); } - ret = 0; } if (ret < 0) errval = errno; } else if (f->filetype == FIO_TYPE_CHAR || f->filetype == FIO_TYPE_PIPE) { dprint(FD_IO, "invalidate not supported %s\n", f->file_name); - ret = 0; } /* @@ -1608,8 +1605,9 @@ int add_file(struct thread_data *td, const char *fname, int numjob, int inc) f->file_name = strdup(file_name); else f->file_name = smalloc_strdup(file_name); - if (!f->file_name) - assert(0); + + /* can't handle smalloc failure from here */ + assert(f->file_name); get_file_type(f); @@ -1814,9 +1812,9 @@ void dup_files(struct thread_data *td, struct thread_data *org) __f->file_name = strdup(f->file_name); else __f->file_name = smalloc_strdup(f->file_name); - if (!__f->file_name) - assert(0); + /* can't handle smalloc failure from here */ + assert(__f->file_name); __f->filetype = f->filetype; }