projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
filesetup: add direct=1 failure warning to layout
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 3b2ebd9c1ec70a3b3361bf15dabe7d56b19c979c..a6a94ee16f64f34467563dcccdef6a640a75792d 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-15,6
+15,7
@@
#include "os/os.h"
#include "hash.h"
#include "lib/axmap.h"
#include "os/os.h"
#include "hash.h"
#include "lib/axmap.h"
+#include "lib/memalign.h"
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
#ifdef CONFIG_LINUX_FALLOCATE
#include <linux/falloc.h>
@@
-67,7
+68,7
@@
static void fallocate_file(struct thread_data *td, struct fio_file *f)
switch (td->o.fallocate_mode) {
case FIO_FALLOCATE_NATIVE:
r = native_fallocate(td, f);
switch (td->o.fallocate_mode) {
case FIO_FALLOCATE_NATIVE:
r = native_fallocate(td, f);
- if (r != 0)
+ if (r != 0
&& errno != ENOSYS
)
log_err("fio: native_fallocate call failed: %s\n",
strerror(errno));
break;
log_err("fio: native_fallocate call failed: %s\n",
strerror(errno));
break;
@@
-100,7
+101,6
@@
static void fallocate_file(struct thread_data *td, struct fio_file *f)
log_err("fio: unknown fallocate mode: %d\n", td->o.fallocate_mode);
assert(0);
}
log_err("fio: unknown fallocate mode: %d\n", td->o.fallocate_mode);
assert(0);
}
-
}
/*
}
/*
@@
-147,6
+147,8
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
flags |= O_CREAT;
if (new_layout)
flags |= O_TRUNC;
flags |= O_CREAT;
if (new_layout)
flags |= O_TRUNC;
+ if (td->o.odirect)
+ flags |= OS_O_DIRECT;
#ifdef WIN32
flags |= _O_BINARY;
#ifdef WIN32
flags |= _O_BINARY;
@@
-160,8
+162,14
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
if (err == ENOENT && !td->o.allow_create)
log_err("fio: file creation disallowed by "
"allow_file_create=0\n");
if (err == ENOENT && !td->o.allow_create)
log_err("fio: file creation disallowed by "
"allow_file_create=0\n");
- else
+ else {
+ if (err == EINVAL && (flags & OS_O_DIRECT))
+ log_err("fio: looks like your filesystem "
+ "does not support "
+ "direct=1/buffered=0\n");
+
td_verror(td, err, "open");
td_verror(td, err, "open");
+ }
return 1;
}
return 1;
}
@@
-193,9
+201,9
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
if (bs > left)
bs = left;
if (bs > left)
bs = left;
- b =
malloc(
bs);
+ b =
fio_memalign(page_size,
bs);
if (!b) {
if (!b) {
- td_verror(td, errno, "
malloc
");
+ td_verror(td, errno, "
fio_memalign
");
goto err;
}
goto err;
}
@@
-248,14
+256,14
@@
static int extend_file(struct thread_data *td, struct fio_file *f)
f->io_size = f->real_file_size;
}
f->io_size = f->real_file_size;
}
- f
ree(b
);
+ f
io_memfree(b, bs
);
done:
return 0;
err:
close(f->fd);
f->fd = -1;
if (b)
done:
return 0;
err:
close(f->fd);
f->fd = -1;
if (b)
- f
ree(b
);
+ f
io_memfree(b, bs
);
return 1;
}
return 1;
}