diff options
author | Sergei Golubchik <serg@mariadb.org> | 2015-12-09 12:57:04 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-12-09 12:57:04 +0100 |
commit | 142b7256070a5fc54f2e841e4bafdd544318eef5 (patch) | |
tree | 70c5afec33298952dbbf9f8724b3450e03795fa6 /storage/xtradb/os | |
parent | 1a72c6fefdb48642f66dc6f32d8bc7a4cc607437 (diff) | |
parent | 9457139e591aa7fb0459788acdbc260db53b0f22 (diff) | |
download | mariadb-git-142b7256070a5fc54f2e841e4bafdd544318eef5.tar.gz |
Merge branch 'merge/merge-xtradb-5.5' into 5.5
5.5.46-37.6
Diffstat (limited to 'storage/xtradb/os')
-rw-r--r-- | storage/xtradb/os/os0file.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/storage/xtradb/os/os0file.c b/storage/xtradb/os/os0file.c index 3cec27f5c97..8870f823db3 100644 --- a/storage/xtradb/os/os0file.c +++ b/storage/xtradb/os/os0file.c @@ -1319,9 +1319,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__ @@ -1344,7 +1345,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; @@ -1405,7 +1407,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); @@ -1418,7 +1421,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); } } |