projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
diskutil: ensure that we lock around disk_list access
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index cf5ec8e95585ffd004c95d3ff4f2e1188aee2ec6..371b40589355848a0b2b63468cece91dcb7815dc 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-526,6
+526,11
@@
open_again:
snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name);
snprintf(buf, sizeof(buf) - 1, "open(%s)", f->file_name);
+ if (__e == EINVAL && (flags & OS_O_DIRECT)) {
+ log_err("fio: looks like your file system does not " \
+ "support direct=1/buffered=0\n");
+ }
+
td_verror(td, __e, buf);
}
td_verror(td, __e, buf);
}
@@
-665,7
+670,7
@@
int setup_files(struct thread_data *td)
dprint(FD_FILE, "setup files\n");
if (td->o.read_iolog_file)
dprint(FD_FILE, "setup files\n");
if (td->o.read_iolog_file)
-
return 0
;
+
goto done
;
/*
* if ioengine defines a setup() method, it's responsible for
/*
* if ioengine defines a setup() method, it's responsible for
@@
-713,7
+718,8
@@
int setup_files(struct thread_data *td)
extend_size = total_size = 0;
need_extend = 0;
for_each_file(td, f, i) {
extend_size = total_size = 0;
need_extend = 0;
for_each_file(td, f, i) {
- f->file_offset = td->o.start_offset;
+ f->file_offset = td->o.start_offset +
+ (td->thread_number - 1) * td->o.offset_increment;
if (!td->o.file_size_low) {
/*
if (!td->o.file_size_low) {
/*
@@
-815,6
+821,11
@@
int setup_files(struct thread_data *td)
*/
if (!td->o.read_iolog_file)
td->total_io_size = td->o.size * td->o.loops;
*/
if (!td->o.read_iolog_file)
td->total_io_size = td->o.size * td->o.loops;
+
+done:
+ if (td->o.create_only)
+ td->done = 1;
+
return 0;
err_offset:
log_err("%s: you need to specify valid offset=\n", td->o.name);
return 0;
err_offset:
log_err("%s: you need to specify valid offset=\n", td->o.name);
@@
-926,10
+937,13
@@
static void get_file_type(struct fio_file *f)
else
f->filetype = FIO_TYPE_FILE;
else
f->filetype = FIO_TYPE_FILE;
+ /* \\.\ 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;
+
if (!stat(f->file_name, &sb)) {
if (!stat(f->file_name, &sb)) {
- /* \\.\ is the device namespace in Windows, where every file is
- * a block device */
- if (S_ISBLK(sb.st_mode) || strncmp(f->file_name, "\\\\.\\", 4) == 0)
+ if (S_ISBLK(sb.st_mode))
f->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
f->filetype = FIO_TYPE_BD;
else if (S_ISCHR(sb.st_mode))
f->filetype = FIO_TYPE_CHAR;
@@
-965,6
+979,7
@@
int add_file(struct thread_data *td, const char *fname)
td->files_size = new_size;
}
td->files[cur_files] = f;
td->files_size = new_size;
}
td->files[cur_files] = f;
+ f->fileno = cur_files;
/*
* init function, io engine may not be loaded yet
/*
* init function, io engine may not be loaded yet