#define DEF_RWMIX_READ (50)
#define DEF_NICE (0)
#define DEF_NR_FILES (1)
+#define DEF_UNLINK (0)
static int def_timeout = DEF_TIMEOUT;
td->filetype = FIO_TYPE_CHAR;
}
+ if (td->odirect)
+ td->io_ops->flags |= FIO_RAWIO;
+
if (td->filetype == FIO_TYPE_FILE) {
char tmp[PATH_MAX];
int len = 0;
for_each_file(td, f, i) {
memset(f, 0, sizeof(*f));
f->fd = -1;
+ f->fileno = i;
sprintf(tmp + len, "%s.%d.%d", jobname, td->thread_number, i);
f->file_name = strdup(tmp);
{
unsigned long seeds[4];
int fd, num_maps, blocks, i;
+ struct fio_file *f;
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1) {
if (td->rand_repeatable)
seeds[3] = DEF_RANDSEED;
- for (i = 0; i < td->nr_files; i++) {
- struct fio_file *f = &td->files[i];
-
+ for_each_file(td, f, i) {
blocks = (f->file_size + td->min_bs - 1) / td->min_bs;
num_maps = blocks / BLOCKS_PER_MAP;
f->file_map = malloc(num_maps * sizeof(long));
fgetpos(f, &off);
continue;
}
+ if (!check_strset(p, "unlink")) {
+ td->unlink = 1;
+ fgetpos(f, &off);
+ continue;
+ }
if (!check_strstore(p, "iolog", tmpbuf)) {
if (td->write_iolog) {
log_err("fio: read iolog overrides given write_iolog\n");
def_thread.nice = DEF_NICE;
def_thread.rand_repeatable = DEF_RAND_REPEAT;
def_thread.nr_files = DEF_NR_FILES;
+ def_thread.unlink = DEF_UNLINK;
#ifdef FIO_HAVE_DISK_UTIL
def_thread.do_disk_util = 1;
#endif
return 0;
}
-static void usage(char *name)
+static void usage(void)
{
printf("%s\n", fio_version_string);
printf("\t-o Write output to file\n");
idx = optind;
break;
case 'h':
- usage(argv[0]);
+ usage();
exit(0);
case 'v':
printf("%s\n", fio_version_string);
job_files = parse_cmd_line(argc, argv);
if (!job_files) {
log_err("Need job file(s)\n");
- usage(argv[0]);
+ usage();
return 1;
}