X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=filesetup.c;h=ef94bd285210d5009e6498d233375317971917ad;hp=c6ef3bf2744f52a70e8bf845a65d4877ed7e8e4b;hb=465920381b80d2a6ee472f498e7d7444a310160b;hpb=7903bf87725b18495a06f7199342f167147712eb diff --git a/filesetup.c b/filesetup.c index c6ef3bf2..ef94bd28 100644 --- a/filesetup.c +++ b/filesetup.c @@ -948,9 +948,8 @@ int setup_files(struct thread_data *td) if (need_extend) { temp_stall_ts = 1; if (output_format & FIO_OUTPUT_NORMAL) - log_info("%s: Laying out IO file(s) (%u file(s) /" - " %lluMB)\n", o->name, need_extend, - extend_size >> 20); + log_info("%s: Laying out IO file(s) (%u file(s) / %lluMiB)\n", + o->name, need_extend, extend_size >> 20); for_each_file(td, f, i) { unsigned long long old_len = -1ULL, extend_len = -1ULL; @@ -1098,7 +1097,7 @@ static int check_rand_gen_limits(struct thread_data *td, struct fio_file *f, if (!fio_option_is_set(&td->o, random_generator)) { log_info("fio: Switching to tausworthe64. Use the " "random_generator= option to get rid of this " - " warning.\n"); + "warning.\n"); td->o.random_generator = FIO_RAND_GEN_TAUSWORTHE64; return 0; } @@ -1242,12 +1241,14 @@ static void get_file_type(struct fio_file *f) } } -static bool __is_already_allocated(const char *fname) +static bool __is_already_allocated(const char *fname, bool set) { struct flist_head *entry; + bool ret; - if (flist_empty(&filename_list)) - return false; + ret = file_bloom_exists(fname, set); + if (!ret) + return ret; flist_for_each(entry, &filename_list) { struct file_name *fn; @@ -1266,7 +1267,7 @@ static bool is_already_allocated(const char *fname) bool ret; fio_file_hash_lock(); - ret = __is_already_allocated(fname); + ret = __is_already_allocated(fname, false); fio_file_hash_unlock(); return ret; @@ -1280,7 +1281,7 @@ static void set_already_allocated(const char *fname) fn->filename = strdup(fname); fio_file_hash_lock(); - if (!__is_already_allocated(fname)) { + if (!__is_already_allocated(fname, true)) { flist_add_tail(&fn->list, &filename_list); fn = NULL; } @@ -1317,7 +1318,6 @@ static struct fio_file *alloc_new_file(struct thread_data *td) f = smalloc(sizeof(*f)); if (!f) { - log_err("fio: smalloc OOM\n"); assert(0); return NULL; } @@ -1400,10 +1400,8 @@ int add_file(struct thread_data *td, const char *fname, int numjob, int inc) f->real_file_size = -1ULL; f->file_name = smalloc_strdup(file_name); - if (!f->file_name) { - log_err("fio: smalloc OOM\n"); + if (!f->file_name) assert(0); - } get_file_type(f); @@ -1606,10 +1604,8 @@ void dup_files(struct thread_data *td, struct thread_data *org) if (f->file_name) { __f->file_name = smalloc_strdup(f->file_name); - if (!__f->file_name) { - log_err("fio: smalloc OOM\n"); + if (!__f->file_name) assert(0); - } __f->filetype = f->filetype; }