summaryrefslogtreecommitdiff
path: root/storage/xtradb/os
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-12-09 12:27:04 +0100
committerSergei Golubchik <serg@mariadb.org>2015-12-09 12:27:04 +0100
commit9457139e591aa7fb0459788acdbc260db53b0f22 (patch)
tree0d694e13a2c8d3ad7a4375ebf647150a67367095 /storage/xtradb/os
parentdb79f4cf613c77391216988d2a9273a68e0c3c11 (diff)
downloadmariadb-git-9457139e591aa7fb0459788acdbc260db53b0f22.tar.gz
5.5.46-37.6
Diffstat (limited to 'storage/xtradb/os')
-rw-r--r--storage/xtradb/os/os0file.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c
index ebcacc5c94f..6e1b59aba12 100644
--- a/storage/xtradb/os/os0file.c
+++ b/storage/xtradb/os/os0file.c
@@ -1231,9 +1231,10 @@ os_file_create_simple_no_error_handling_func(
OS_FILE_CREATE if a new file is created
(if exists, error) */
ulint access_type,/*!< in: OS_FILE_READ_ONLY,
- OS_FILE_READ_WRITE, or
- OS_FILE_READ_ALLOW_DELETE; the last option is
- used by a backup program reading the file */
+ OS_FILE_READ_WRITE, OS_FILE_READ_ALLOW_DELETE
+ (used by a backup program reading the file), or
+ OS_FILE_READ_WRITE_CACHED (disable O_DIRECT if
+ it would be enabled otherwise). */
ibool* success)/*!< out: TRUE if succeed, FALSE if error */
{
#ifdef __WIN__
@@ -1256,7 +1257,8 @@ os_file_create_simple_no_error_handling_func(
if (access_type == OS_FILE_READ_ONLY) {
access = GENERIC_READ;
- } else if (access_type == OS_FILE_READ_WRITE) {
+ } else if (access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED) {
access = GENERIC_READ | GENERIC_WRITE;
} else if (access_type == OS_FILE_READ_ALLOW_DELETE) {
access = GENERIC_READ;
@@ -1317,7 +1319,8 @@ os_file_create_simple_no_error_handling_func(
if (file == -1) {
*success = FALSE;
#ifdef USE_FILE_LOCK
- } else if (access_type == OS_FILE_READ_WRITE
+ } else if ((access_type == OS_FILE_READ_WRITE
+ || access_type == OS_FILE_READ_WRITE_CACHED)
&& os_file_lock(file, name)) {
*success = FALSE;
close(file);
@@ -1330,7 +1333,9 @@ os_file_create_simple_no_error_handling_func(
disable OS caching (O_DIRECT) here as we do in
os_file_create_func(), so we open the same file in the same
mode, see man page of open(2). */
- if (srv_unix_file_flush_method == SRV_UNIX_O_DIRECT) {
+ if ((srv_unix_file_flush_method == SRV_UNIX_O_DIRECT
+ || srv_unix_file_flush_method == SRV_UNIX_ALL_O_DIRECT)
+ && access_type != OS_FILE_READ_WRITE_CACHED) {
os_file_set_nocache(file, name, mode_str);
}
}