X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=filesetup.c;h=ed3646a4bbe75e598e556970084bcb328c30fa3e;hb=fd9882facefa0f5b09c09d2bc5cb3a2b6eabda1a;hp=7d54c9f1ef5bc8f92b0e5bbf19285d2f7ecfed17;hpb=78f59d40ab927e91f0b46573831d0fe1422ab5f3;p=fio.git diff --git a/filesetup.c b/filesetup.c index 7d54c9f1..ed3646a4 100644 --- a/filesetup.c +++ b/filesetup.c @@ -95,6 +95,18 @@ static void fallocate_file(struct thread_data *td, struct fio_file *f) break; } #endif /* CONFIG_LINUX_FALLOCATE */ + case FIO_FALLOCATE_TRUNCATE: { + int r; + + dprint(FD_FILE, "ftruncate file %s size %llu\n", + f->file_name, + (unsigned long long) f->real_file_size); + r = ftruncate(f->fd, f->real_file_size); + if (r != 0) + td_verror(td, errno, "ftruncate"); + + break; + } default: log_err("fio: unknown fallocate mode: %d\n", td->o.fallocate_mode); assert(0); @@ -1275,7 +1287,9 @@ static bool init_rand_distribution(struct thread_data *td) unsigned int i; int state; - if (td->o.random_distribution == FIO_RAND_DIST_RANDOM) + if (td->o.random_distribution == FIO_RAND_DIST_RANDOM || + td->o.random_distribution == FIO_RAND_DIST_ZONED || + td->o.random_distribution == FIO_RAND_DIST_ZONED_ABS) return false; state = td_bump_runstate(td, TD_SETTING_UP);