if (f->filetype == FIO_TYPE_FILE)
ret = file_size(td, f);
- else if (f->filetype == FIO_TYPE_BD)
+ else if (f->filetype == FIO_TYPE_BLOCK)
ret = bdev_size(td, f);
else if (f->filetype == FIO_TYPE_CHAR)
ret = char_size(td, f);
ret = posix_fadvise(f->fd, off, len, POSIX_FADV_DONTNEED);
if (ret)
errval = ret;
- } else if (f->filetype == FIO_TYPE_BD) {
+ } else if (f->filetype == FIO_TYPE_BLOCK) {
int retry_count = 0;
ret = blockdev_invalidate_cache(f);
struct stat sb;
char buf[256];
- if (f->filetype == FIO_TYPE_BD || f->filetype == FIO_TYPE_CHAR) {
+ if (f->filetype == FIO_TYPE_BLOCK || f->filetype == FIO_TYPE_CHAR) {
if (f->real_file_size != -1ULL)
ret += f->real_file_size;
continue;
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;
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;
}
/* \\.\ is the device namespace in Windows, where every file is
* a block device */
if (strncmp(f->file_name, "\\\\.\\", 4) == 0)
- f->filetype = FIO_TYPE_BD;
+ f->filetype = FIO_TYPE_BLOCK;
#endif
if (!stat(f->file_name, &sb)) {
if (S_ISBLK(sb.st_mode))
- f->filetype = FIO_TYPE_BD;
+ f->filetype = FIO_TYPE_BLOCK;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
else if (S_ISFIFO(sb.st_mode))
}
}
-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;
bool ret;
fio_file_hash_lock();
- ret = __is_already_allocated(fname);
+ ret = __is_already_allocated(fname, false);
fio_file_hash_unlock();
return ret;
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;
}
f = smalloc(sizeof(*f));
if (!f) {
- log_err("fio: smalloc OOM\n");
assert(0);
return NULL;
}
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);
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;
}