projects
/
fio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f271a3f
)
filesetup: keep OS_O_DIRECT flag when pre-allocating file
author
weiping zhang
<zhangweiping@didichuxing.com>
Sat, 29 Jul 2017 08:47:59 +0000
(16:47 +0800)
committer
weiping zhang
<zhangweiping@didichuxing.com>
Sun, 30 Jul 2017 12:07:32 +0000
(20:07 +0800)
When direct=1 the file open for pre-allocation should also set OS_O_DIRECT so
we fail earlier if the filesystem/file doesn't support direct operations.
Signed-off-by: weiping zhang <zhangweiping@didichuxing.com>
filesetup.c
patch
|
blob
|
blame
|
history
diff --git
a/filesetup.c
b/filesetup.c
index 839aefc33752e28c7a8e7a628593f9f8f758066f..0e5599ab16502e9541023af6028e9814f366a844 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-146,6
+146,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;