提交 a82a87f2 编写于 作者: J Jiri Denemark

Create raw storage files with O_DSYNC

When creating preallocated large raw files opening them with O_DSYNC
prevents long delays in reading because cache pages can be immediately
reused without writing them on a disk first.
上级 5dee786d
......@@ -300,7 +300,7 @@ virStorageBackendCreateRaw(virConnectPtr conn,
goto cleanup;
}
if ((fd = open(vol->target.path, O_RDWR | O_EXCL)) < 0) {
if ((fd = open(vol->target.path, O_RDWR | O_EXCL | O_DSYNC)) < 0) {
virReportSystemError(errno,
_("cannot open new path '%s'"),
vol->target.path);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册