49 extern ibool os_has_said_disk_full;
70 #define UNIV_NON_BUFFERED_IO
78 # define os_file_t HANDLE
82 # define OS_FILE_FROM_FD(fd) (HANDLE) _get_osfhandle(fd)
89 # define OS_FILE_FROM_FD(fd) fd
102 #define OS_FILE_LOG_BLOCK_SIZE 512
127 #define OS_FILE_READ_ONLY 333
128 #define OS_FILE_READ_WRITE 444
129 #define OS_FILE_READ_ALLOW_DELETE 555
132 #define OS_FILE_AIO 61
133 #define OS_FILE_NORMAL 62
137 #define OS_DATA_FILE 100
138 #define OS_LOG_FILE 101
142 #define OS_FILE_NOT_FOUND 71
143 #define OS_FILE_DISK_FULL 72
144 #define OS_FILE_ALREADY_EXISTS 73
145 #define OS_FILE_PATH_ERROR 74
146 #define OS_FILE_AIO_RESOURCES_RESERVED 75
148 #define OS_FILE_SHARING_VIOLATION 76
149 #define OS_FILE_ERROR_NOT_SPECIFIED 77
150 #define OS_FILE_INSUFFICIENT_RESOURCE 78
151 #define OS_FILE_AIO_INTERRUPTED 79
152 #define OS_FILE_OPERATION_ABORTED 80
154 #define OS_FILE_ACCESS_VIOLATION 81
156 #define OS_FILE_ERROR_MAX 100
160 #define OS_FILE_READ 10
161 #define OS_FILE_WRITE 11
163 #define OS_FILE_LOG 256
166 #define OS_AIO_N_PENDING_IOS_PER_THREAD 32
170 #define OS_AIO_NORMAL 21
172 #define OS_AIO_IBUF 22
174 #define OS_AIO_LOG 23
175 #define OS_AIO_SYNC 24
185 #define OS_AIO_SIMULATED_WAKE_LATER 512
199 #define OS_WINVISTA 6
205 extern ulint os_n_file_reads;
206 extern ulint os_n_file_writes;
207 extern ulint os_n_fsyncs;
211 extern mysql_pfs_key_t innodb_file_data_key;
212 extern mysql_pfs_key_t innodb_file_log_key;
213 extern mysql_pfs_key_t innodb_file_temp_key;
223 # define register_pfs_file_open_begin(state, locker, key, op, name, \
224 src_file, src_line) \
226 locker = PSI_FILE_CALL(get_thread_file_name_locker)( \
227 state, key, op, name, &locker); \
228 if (UNIV_LIKELY(locker != NULL)) { \
229 PSI_FILE_CALL(start_file_open_wait)( \
230 locker, src_file, src_line); \
234 # define register_pfs_file_open_end(locker, file) \
236 if (UNIV_LIKELY(locker != NULL)) { \
237 PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(\
242 # define register_pfs_file_close_begin(state, locker, key, op, name, \
243 src_file, src_line) \
245 locker = PSI_FILE_CALL(get_thread_file_name_locker)( \
246 state, key, op, name, &locker); \
247 if (UNIV_LIKELY(locker != NULL)) { \
248 PSI_FILE_CALL(start_file_close_wait)( \
249 locker, src_file, src_line); \
253 # define register_pfs_file_close_end(locker, result) \
255 if (UNIV_LIKELY(locker != NULL)) { \
256 PSI_FILE_CALL(end_file_close_wait)( \
261 # define register_pfs_file_io_begin(state, locker, file, count, op, \
262 src_file, src_line) \
264 locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( \
266 if (UNIV_LIKELY(locker != NULL)) { \
267 PSI_FILE_CALL(start_file_wait)( \
268 locker, count, src_file, src_line); \
272 # define register_pfs_file_io_end(locker, count) \
274 if (UNIV_LIKELY(locker != NULL)) { \
275 PSI_FILE_CALL(end_file_wait)(locker, count); \
297 # define os_file_create(key, name, create, purpose, type, success) \
298 pfs_os_file_create_func(key, name, create, purpose, type, \
299 success, __FILE__, __LINE__)
301 # define os_file_create_simple(key, name, create, access, success) \
302 pfs_os_file_create_simple_func(key, name, create, access, \
303 success, __FILE__, __LINE__)
305 # define os_file_create_simple_no_error_handling( \
306 key, name, create_mode, access, success) \
307 pfs_os_file_create_simple_no_error_handling_func( \
308 key, name, create_mode, access, success, __FILE__, __LINE__)
310 # define os_file_close(file) \
311 pfs_os_file_close_func(file, __FILE__, __LINE__)
313 # define os_aio(type, mode, name, file, buf, offset, \
314 n, message1, message2) \
315 pfs_os_aio_func(type, mode, name, file, buf, offset, \
316 n, message1, message2, __FILE__, __LINE__)
318 # define os_file_read(file, buf, offset, n) \
319 pfs_os_file_read_func(file, buf, offset, n, __FILE__, __LINE__)
321 # define os_file_read_no_error_handling(file, buf, offset, n) \
322 pfs_os_file_read_no_error_handling_func(file, buf, offset, n, \
325 # define os_file_write(name, file, buf, offset, n) \
326 pfs_os_file_write_func(name, file, buf, offset, \
327 n, __FILE__, __LINE__)
329 # define os_file_flush(file) \
330 pfs_os_file_flush_func(file, __FILE__, __LINE__)
332 # define os_file_rename(key, oldpath, newpath) \
333 pfs_os_file_rename_func(key, oldpath, newpath, __FILE__, __LINE__)
335 # define os_file_delete(key, name) \
336 pfs_os_file_delete_func(key, name, __FILE__, __LINE__)
338 # define os_file_delete_if_exists(key, name) \
339 pfs_os_file_delete_if_exists_func(key, name, __FILE__, __LINE__)
344 # define os_file_create(key, name, create, purpose, type, success) \
345 os_file_create_func(name, create, purpose, type, success)
347 # define os_file_create_simple(key, name, create_mode, access, success) \
348 os_file_create_simple_func(name, create_mode, access, success)
350 # define os_file_create_simple_no_error_handling( \
351 key, name, create_mode, access, success) \
352 os_file_create_simple_no_error_handling_func( \
353 name, create_mode, access, success)
355 # define os_file_close(file) os_file_close_func(file)
357 # define os_aio(type, mode, name, file, buf, offset, n, message1, message2) \
358 os_aio_func(type, mode, name, file, buf, offset, n, \
361 # define os_file_read(file, buf, offset, n) \
362 os_file_read_func(file, buf, offset, n)
364 # define os_file_read_no_error_handling(file, buf, offset, n) \
365 os_file_read_no_error_handling_func(file, buf, offset, n)
367 # define os_file_write(name, file, buf, offset, n) \
368 os_file_write_func(name, file, buf, offset, n)
370 # define os_file_flush(file) os_file_flush_func(file)
372 # define os_file_rename(key, oldpath, newpath) \
373 os_file_rename_func(oldpath, newpath)
375 # define os_file_delete(key, name) os_file_delete_func(name)
377 # define os_file_delete_if_exists(key, name) \
378 os_file_delete_if_exists_func(name)
384 enum os_file_type_t {
385 OS_FILE_TYPE_UNKNOWN = 0,
396 #define OS_FILE_MAX_PATH 4000
424 os_get_os_version(
void);
427 #ifndef UNIV_HOTBACKUP
455 ibool error_is_fatal);
489 const char* pathname,
491 ibool fail_if_exists);
527 __attribute__((nonnull, warn_unused_result));
537 const char* operation_name);
561 __attribute__((nonnull, warn_unused_result));
593 const char* newpath);
616 pfs_os_file_create_simple_func(
625 const char* src_file,
627 __attribute__((nonnull, warn_unused_result));
639 pfs_os_file_create_simple_no_error_handling_func(
650 const char* src_file,
652 __attribute__((nonnull, warn_unused_result));
663 pfs_os_file_create_func(
678 const char* src_file,
680 __attribute__((nonnull, warn_unused_result));
689 pfs_os_file_close_func(
692 const char* src_file,
702 pfs_os_file_read_func(
708 const char* src_file,
720 pfs_os_file_read_no_error_handling_func(
726 const char* src_file,
748 fil_node_t* message1,
756 const char* src_file,
766 pfs_os_file_write_func(
774 const char* src_file,
785 pfs_os_file_flush_func(
788 const char* src_file,
799 pfs_os_file_rename_func(
805 const char* src_file,
816 pfs_os_file_delete_func(
821 const char* src_file,
832 pfs_os_file_delete_if_exists_func(
837 const char* src_file,
841 #ifdef UNIV_HOTBACKUP
847 os_file_close_no_error_handling(
859 __attribute__((warn_unused_result));
871 __attribute__((nonnull, warn_unused_result));
899 bool report_all_errors);
963 os_file_type_t* type);
1012 const char* old_path,
1013 const char* new_name);
1031 const char* data_dir_path,
1032 const char* tablename,
1033 const char* extention);
1050 char* data_dir_path);
1074 ulint n_slots_sync);
1112 fil_node_t* message1,
1161 os_aio_windows_handle(
1173 fil_node_t**message1,
1195 fil_node_t**message1,
1243 bool check_rw_perm);
1246 #if !defined(UNIV_HOTBACKUP)
1258 #if defined(LINUX_NATIVE_AIO)
1269 os_aio_linux_handle(
1277 fil_node_t**message1,