InnoDB Plugin  1.0
os0file.h
Go to the documentation of this file.
1 /***********************************************************************
2 
3 Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
4 Copyright (c) 2009, Percona Inc.
5 
6 Portions of this file contain modifications contributed and copyrighted
7 by Percona Inc.. Those modifications are
8 gratefully acknowledged and are described briefly in the InnoDB
9 documentation. The contributions by Percona Inc. are incorporated with
10 their permission, and subject to the conditions contained in the file
11 COPYING.Percona.
12 
13 This program is free software; you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by the
15 Free Software Foundation; version 2 of the License.
16 
17 This program is distributed in the hope that it will be useful, but
18 WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
20 Public License for more details.
21 
22 You should have received a copy of the GNU General Public License along with
23 this program; if not, write to the Free Software Foundation, Inc.,
24 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA
25 
26 ***********************************************************************/
27 
28 /**************************************************/
35 #ifndef os0file_h
36 #define os0file_h
37 
38 #include "univ.i"
39 
40 #ifndef __WIN__
41 #include <dirent.h>
42 #include <sys/stat.h>
43 #include <time.h>
44 #endif
45 
47 struct fil_node_t;
48 
49 extern ibool os_has_said_disk_full;
52 
54 extern ulint os_file_n_pending_preads;
56 extern ulint os_file_n_pending_pwrites;
57 
59 extern ulint os_n_pending_reads;
61 extern ulint os_n_pending_writes;
62 
63 #ifdef __WIN__
64 
67 #define WIN_ASYNC_IO
68 
70 #define UNIV_NON_BUFFERED_IO
71 
72 #endif
73 
75 typedef ib_uint64_t os_offset_t;
76 #ifdef __WIN__
77 
78 # define os_file_t HANDLE
79 
82 # define OS_FILE_FROM_FD(fd) (HANDLE) _get_osfhandle(fd)
83 #else
84 
85 typedef int os_file_t;
89 # define OS_FILE_FROM_FD(fd) fd
90 #endif
91 
93 extern ulint os_innodb_umask;
94 
102 #define OS_FILE_LOG_BLOCK_SIZE 512
103 
125 };
126 
127 #define OS_FILE_READ_ONLY 333
128 #define OS_FILE_READ_WRITE 444
129 #define OS_FILE_READ_ALLOW_DELETE 555 /* for mysqlbackup */
130 
131 /* Options for file_create */
132 #define OS_FILE_AIO 61
133 #define OS_FILE_NORMAL 62
134 /* @} */
135 
137 #define OS_DATA_FILE 100
138 #define OS_LOG_FILE 101
139 /* @} */
140 
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 /* wait for OS aio resources
147  to become available again */
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
153 
154 #define OS_FILE_ACCESS_VIOLATION 81
155 
156 #define OS_FILE_ERROR_MAX 100
157 /* @} */
158 
160 #define OS_FILE_READ 10
161 #define OS_FILE_WRITE 11
162 
163 #define OS_FILE_LOG 256 /* This can be ORed to type */
164 /* @} */
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
191 /* @} */
193 #define OS_WIN31 1
194 #define OS_WIN95 2
195 #define OS_WINNT 3
196 #define OS_WIN2000 4
197 #define OS_WINXP 5
199 #define OS_WINVISTA 6
201 #define OS_WIN7 7
205 extern ulint os_n_file_reads;
206 extern ulint os_n_file_writes;
207 extern ulint os_n_fsyncs;
208 
209 #ifdef UNIV_PFS_IO
210 /* Keys to register InnoDB I/O with performance schema */
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;
214 
215 /* Following four macros are instumentations to register
216 various file I/O operations with performance schema.
217 1) register_pfs_file_open_begin() and register_pfs_file_open_end() are
218 used to register file creation, opening, closing and renaming.
219 2) register_pfs_file_io_begin() and register_pfs_file_io_end() are
220 used to register actual file read, write and flush
221 3) register_pfs_file_close_begin() and register_pfs_file_close_end()
222 are used to register file deletion operations*/
223 # define register_pfs_file_open_begin(state, locker, key, op, name, \
224  src_file, src_line) \
225 do { \
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); \
231  } \
232 } while (0)
233 
234 # define register_pfs_file_open_end(locker, file) \
235 do { \
236  if (UNIV_LIKELY(locker != NULL)) { \
237  PSI_FILE_CALL(end_file_open_wait_and_bind_to_descriptor)(\
238  locker, file); \
239  } \
240 } while (0)
241 
242 # define register_pfs_file_close_begin(state, locker, key, op, name, \
243  src_file, src_line) \
244 do { \
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); \
250  } \
251 } while (0)
252 
253 # define register_pfs_file_close_end(locker, result) \
254 do { \
255  if (UNIV_LIKELY(locker != NULL)) { \
256  PSI_FILE_CALL(end_file_close_wait)( \
257  locker, result); \
258  } \
259 } while (0)
260 
261 # define register_pfs_file_io_begin(state, locker, file, count, op, \
262  src_file, src_line) \
263 do { \
264  locker = PSI_FILE_CALL(get_thread_file_descriptor_locker)( \
265  state, file, op); \
266  if (UNIV_LIKELY(locker != NULL)) { \
267  PSI_FILE_CALL(start_file_wait)( \
268  locker, count, src_file, src_line); \
269  } \
270 } while (0)
271 
272 # define register_pfs_file_io_end(locker, count) \
273 do { \
274  if (UNIV_LIKELY(locker != NULL)) { \
275  PSI_FILE_CALL(end_file_wait)(locker, count); \
276  } \
277 } while (0)
278 #endif /* UNIV_PFS_IO */
279 
280 /* Following macros/functions are file I/O APIs that would be performance
281 schema instrumented if "UNIV_PFS_IO" is defined. They would point to
282 wrapper functions with performance schema instrumentation in such case.
283 
284 os_file_create
285 os_file_create_simple
286 os_file_create_simple_no_error_handling
287 os_file_close
288 os_file_rename
289 os_aio
290 os_file_read
291 os_file_read_no_error_handling
292 os_file_write
293 
294 The wrapper functions have the prefix of "innodb_". */
295 
296 #ifdef UNIV_PFS_IO
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__)
300 
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__)
304 
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__)
309 
310 # define os_file_close(file) \
311  pfs_os_file_close_func(file, __FILE__, __LINE__)
312 
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__)
317 
318 # define os_file_read(file, buf, offset, n) \
319  pfs_os_file_read_func(file, buf, offset, n, __FILE__, __LINE__)
320 
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, \
323  __FILE__, __LINE__)
324 
325 # define os_file_write(name, file, buf, offset, n) \
326  pfs_os_file_write_func(name, file, buf, offset, \
327  n, __FILE__, __LINE__)
328 
329 # define os_file_flush(file) \
330  pfs_os_file_flush_func(file, __FILE__, __LINE__)
331 
332 # define os_file_rename(key, oldpath, newpath) \
333  pfs_os_file_rename_func(key, oldpath, newpath, __FILE__, __LINE__)
334 
335 # define os_file_delete(key, name) \
336  pfs_os_file_delete_func(key, name, __FILE__, __LINE__)
337 
338 # define os_file_delete_if_exists(key, name) \
339  pfs_os_file_delete_if_exists_func(key, name, __FILE__, __LINE__)
340 #else /* UNIV_PFS_IO */
341 
342 /* If UNIV_PFS_IO is not defined, these I/O APIs point
343 to original un-instrumented file I/O APIs */
344 # define os_file_create(key, name, create, purpose, type, success) \
345  os_file_create_func(name, create, purpose, type, success)
346 
347 # define os_file_create_simple(key, name, create_mode, access, success) \
348  os_file_create_simple_func(name, create_mode, access, success)
349 
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)
354 
355 # define os_file_close(file) os_file_close_func(file)
356 
357 # define os_aio(type, mode, name, file, buf, offset, n, message1, message2) \
358  os_aio_func(type, mode, name, file, buf, offset, n, \
359  message1, message2)
360 
361 # define os_file_read(file, buf, offset, n) \
362  os_file_read_func(file, buf, offset, n)
363 
364 # define os_file_read_no_error_handling(file, buf, offset, n) \
365  os_file_read_no_error_handling_func(file, buf, offset, n)
366 
367 # define os_file_write(name, file, buf, offset, n) \
368  os_file_write_func(name, file, buf, offset, n)
369 
370 # define os_file_flush(file) os_file_flush_func(file)
371 
372 # define os_file_rename(key, oldpath, newpath) \
373  os_file_rename_func(oldpath, newpath)
374 
375 # define os_file_delete(key, name) os_file_delete_func(name)
376 
377 # define os_file_delete_if_exists(key, name) \
378  os_file_delete_if_exists_func(name)
379 
380 #endif /* UNIV_PFS_IO */
381 
382 /* File types for directory entry data type */
383 
384 enum os_file_type_t {
385  OS_FILE_TYPE_UNKNOWN = 0,
386  OS_FILE_TYPE_FILE, /* regular file */
387  OS_FILE_TYPE_DIR, /* directory */
388  OS_FILE_TYPE_LINK, /* symbolic link */
389  OS_FILE_TYPE_BLOCK /* block device */
390 };
391 
392 /* Maximum path string length in bytes when referring to tables with in the
393 './databasename/tablename.ibd' path format; we can allocate at least 2 buffers
394 of this size from the thread stack; that is why this should not be made much
395 bigger than 4000 bytes */
396 #define OS_FILE_MAX_PATH 4000
397 
400  char name[OS_FILE_MAX_PATH];
401  os_file_type_t type;
402  ib_int64_t size;
403  time_t ctime;
404  time_t mtime;
405  time_t atime;
406  bool rw_perm;
409 };
410 
411 #ifdef __WIN__
412 typedef HANDLE os_file_dir_t;
413 #else
414 typedef DIR* os_file_dir_t;
415 #endif
416 
417 #ifdef __WIN__
418 /***********************************************************************/
422 UNIV_INTERN
423 ulint
424 os_get_os_version(void);
425 /*===================*/
426 #endif /* __WIN__ */
427 #ifndef UNIV_HOTBACKUP
428 /****************************************************************/
430 UNIV_INTERN
431 void
432 os_io_init_simple(void);
433 /*===================*/
434 /***********************************************************************/
439 FILE*
441 /*========================*/
442 #endif /* !UNIV_HOTBACKUP */
443 /***********************************************************************/
449 UNIV_INTERN
452 /*============*/
453  const char* dirname,
455  ibool error_is_fatal);
460 /***********************************************************************/
463 UNIV_INTERN
464 int
466 /*=============*/
467  os_file_dir_t dir);
468 /***********************************************************************/
472 UNIV_INTERN
473 int
475 /*======================*/
476  const char* dirname,
477  os_file_dir_t dir,
478  os_file_stat_t* info);
479 /*****************************************************************/
485 UNIV_INTERN
486 ibool
488 /*=====================*/
489  const char* pathname,
491  ibool fail_if_exists);
493 /****************************************************************/
499 UNIV_INTERN
500 os_file_t
502 /*=======================*/
503  const char* name,
505  ulint create_mode,
506  ulint access_type,
508  ibool* success);
509 /****************************************************************/
515 UNIV_INTERN
516 os_file_t
518 /*=========================================*/
519  const char* name,
521  ulint create_mode,
522  ulint access_type,
526  ibool* success)
527  __attribute__((nonnull, warn_unused_result));
528 /****************************************************************/
530 UNIV_INTERN
531 void
533 /*================*/
534  int fd,
535  const char* file_name,
537  const char* operation_name);
539 /****************************************************************/
545 UNIV_INTERN
546 os_file_t
548 /*================*/
549  const char* name,
551  ulint create_mode,
552  ulint purpose,
559  ulint type,
560  ibool* success)
561  __attribute__((nonnull, warn_unused_result));
562 /***********************************************************************/
565 UNIV_INTERN
566 bool
568 /*================*/
569  const char* name);
572 /***********************************************************************/
575 UNIV_INTERN
576 bool
578 /*==========================*/
579  const char* name);
581 /***********************************************************************/
587 UNIV_INTERN
588 ibool
590 /*================*/
591  const char* oldpath,
593  const char* newpath);
594 /***********************************************************************/
600 UNIV_INTERN
601 ibool
603 /*===============*/
604  os_file_t file);
606 #ifdef UNIV_PFS_IO
607 /****************************************************************/
614 UNIV_INLINE
615 os_file_t
616 pfs_os_file_create_simple_func(
617 /*===========================*/
618  mysql_pfs_key_t key,
619  const char* name,
621  ulint create_mode,
622  ulint access_type,
624  ibool* success,
625  const char* src_file,
626  ulint src_line)
627  __attribute__((nonnull, warn_unused_result));
628 
629 /****************************************************************/
637 UNIV_INLINE
638 os_file_t
639 pfs_os_file_create_simple_no_error_handling_func(
640 /*=============================================*/
641  mysql_pfs_key_t key,
642  const char* name,
644  ulint create_mode,
645  ulint access_type,
649  ibool* success,
650  const char* src_file,
651  ulint src_line)
652  __attribute__((nonnull, warn_unused_result));
653 
654 /****************************************************************/
661 UNIV_INLINE
662 os_file_t
663 pfs_os_file_create_func(
664 /*====================*/
665  mysql_pfs_key_t key,
666  const char* name,
668  ulint create_mode,
669  ulint purpose,
676  ulint type,
677  ibool* success,
678  const char* src_file,
679  ulint src_line)
680  __attribute__((nonnull, warn_unused_result));
681 
682 /***********************************************************************/
687 UNIV_INLINE
688 ibool
689 pfs_os_file_close_func(
690 /*===================*/
691  os_file_t file,
692  const char* src_file,
693  ulint src_line);
694 /*******************************************************************/
700 UNIV_INLINE
701 ibool
702 pfs_os_file_read_func(
703 /*==================*/
704  os_file_t file,
705  void* buf,
706  os_offset_t offset,
707  ulint n,
708  const char* src_file,
709  ulint src_line);
711 /*******************************************************************/
718 UNIV_INLINE
719 ibool
720 pfs_os_file_read_no_error_handling_func(
721 /*====================================*/
722  os_file_t file,
723  void* buf,
724  os_offset_t offset,
725  ulint n,
726  const char* src_file,
727  ulint src_line);
729 /*******************************************************************/
735 UNIV_INLINE
736 ibool
737 pfs_os_aio_func(
738 /*============*/
739  ulint type,
740  ulint mode,
741  const char* name,
743  os_file_t file,
744  void* buf,
746  os_offset_t offset,
747  ulint n,
748  fil_node_t* message1,
752  void* message2,
756  const char* src_file,
757  ulint src_line);
758 /*******************************************************************/
764 UNIV_INLINE
765 ibool
766 pfs_os_file_write_func(
767 /*===================*/
768  const char* name,
770  os_file_t file,
771  const void* buf,
772  os_offset_t offset,
773  ulint n,
774  const char* src_file,
775  ulint src_line);
776 /***********************************************************************/
783 UNIV_INLINE
784 ibool
785 pfs_os_file_flush_func(
786 /*===================*/
787  os_file_t file,
788  const char* src_file,
789  ulint src_line);
791 /***********************************************************************/
797 UNIV_INLINE
798 ibool
799 pfs_os_file_rename_func(
800 /*====================*/
801  mysql_pfs_key_t key,
802  const char* oldpath,
804  const char* newpath,
805  const char* src_file,
806  ulint src_line);
808 /***********************************************************************/
814 UNIV_INLINE
815 bool
816 pfs_os_file_delete_func(
817 /*====================*/
818  mysql_pfs_key_t key,
819  const char* name,
821  const char* src_file,
822  ulint src_line);
824 /***********************************************************************/
830 UNIV_INLINE
831 bool
832 pfs_os_file_delete_if_exists_func(
833 /*==============================*/
834  mysql_pfs_key_t key,
835  const char* name,
837  const char* src_file,
838  ulint src_line);
839 #endif /* UNIV_PFS_IO */
840 
841 #ifdef UNIV_HOTBACKUP
842 /***********************************************************************/
845 UNIV_INTERN
846 ibool
847 os_file_close_no_error_handling(
848 /*============================*/
849  os_file_t file);
850 #endif /* UNIV_HOTBACKUP */
851 /***********************************************************************/
854 UNIV_INTERN
857 /*=============*/
858  os_file_t file)
859  __attribute__((warn_unused_result));
860 /***********************************************************************/
863 UNIV_INTERN
864 ibool
866 /*=============*/
867  const char* name,
869  os_file_t file,
870  os_offset_t size)
871  __attribute__((nonnull, warn_unused_result));
872 /***********************************************************************/
875 UNIV_INTERN
876 ibool
878 /*============*/
879  FILE* file);
880 /***********************************************************************/
884 UNIV_INTERN
885 ibool
887 /*===============*/
888  os_file_t file);
889 /***********************************************************************/
895 UNIV_INTERN
896 ulint
898 /*===================*/
899  bool report_all_errors);
901 /*******************************************************************/
905 UNIV_INTERN
906 ibool
908 /*==============*/
909  os_file_t file,
910  void* buf,
911  os_offset_t offset,
912  ulint n);
913 /*******************************************************************/
917 UNIV_INTERN
918 void
920 /*================*/
921  FILE* file,
922  char* str,
923  ulint size);
924 /*******************************************************************/
930 UNIV_INTERN
931 ibool
933 /*================================*/
934  os_file_t file,
935  void* buf,
936  os_offset_t offset,
937  ulint n);
939 /*******************************************************************/
944 UNIV_INTERN
945 ibool
947 /*===============*/
948  const char* name,
950  os_file_t file,
951  const void* buf,
952  os_offset_t offset,
953  ulint n);
954 /*******************************************************************/
957 UNIV_INTERN
958 ibool
960 /*===========*/
961  const char* path,
962  ibool* exists,
963  os_file_type_t* type);
964 /****************************************************************/
992 UNIV_INTERN
993 char*
995 /*============*/
996  const char* path);
997 /****************************************************************/
1008 UNIV_INTERN
1009 char*
1011 /*======================*/
1012  const char* old_path,
1013  const char* new_name);
1014 /****************************************************************/
1027 UNIV_INTERN
1028 char*
1030 /*=========================*/
1031  const char* data_dir_path,
1032  const char* tablename,
1033  const char* extention);
1034 /****************************************************************/
1046 UNIV_INTERN
1047 void
1049 /*========================*/
1050  char* data_dir_path);
1051 /****************************************************************/
1054 UNIV_INTERN
1055 ibool
1057 /*=============================*/
1058  const char* path);
1059 /***********************************************************************
1060 Initializes the asynchronous io system. Creates one array each for ibuf
1061 and log i/o. Also creates one array each for read and write where each
1062 array is divided logically into n_read_segs and n_write_segs
1063 respectively. The caller must create an i/o handler thread for each
1064 segment in these arrays. This function also creates the sync array.
1065 No i/o handler thread needs to be created for that */
1066 UNIV_INTERN
1067 ibool
1068 os_aio_init(
1069 /*========*/
1070  ulint n_per_seg, /*<! in: maximum number of pending aio
1071  operations allowed per segment */
1072  ulint n_read_segs, /*<! in: number of reader threads */
1073  ulint n_write_segs, /*<! in: number of writer threads */
1074  ulint n_slots_sync); /*<! in: number of slots in the sync aio
1075  array */
1076 /***********************************************************************
1077 Frees the asynchronous io system. */
1078 UNIV_INTERN
1079 void
1080 os_aio_free(void);
1081 /*=============*/
1082 
1083 /*******************************************************************/
1087 UNIV_INTERN
1088 ibool
1089 os_aio_func(
1090 /*========*/
1091  ulint type,
1092  ulint mode,
1105  const char* name,
1107  os_file_t file,
1108  void* buf,
1110  os_offset_t offset,
1111  ulint n,
1112  fil_node_t* message1,
1116  void* message2);
1120 /************************************************************************/
1123 UNIV_INTERN
1124 void
1126 /*=====================================*/
1127 /************************************************************************/
1130 UNIV_INTERN
1131 void
1133 /*=====================================*/
1134 /**********************************************************************/
1136 UNIV_INTERN
1137 void
1139 /*=======================================*/
1140 /**********************************************************************/
1145 UNIV_INTERN
1146 void
1148 /*============================================*/
1149 
1150 #ifdef WIN_ASYNC_IO
1151 /**********************************************************************/
1159 UNIV_INTERN
1160 ibool
1161 os_aio_windows_handle(
1162 /*==================*/
1163  ulint segment,
1171  ulint pos,
1173  fil_node_t**message1,
1178  void** message2,
1179  ulint* type);
1180 #endif
1181 
1182 /**********************************************************************/
1186 UNIV_INTERN
1187 ibool
1189 /*====================*/
1190  ulint segment,
1195  fil_node_t**message1,
1200  void** message2,
1201  ulint* type);
1202 /**********************************************************************/
1205 UNIV_INTERN
1206 ibool
1207 os_aio_validate(void);
1208 /*=================*/
1209 /**********************************************************************/
1211 UNIV_INTERN
1212 void
1213 os_aio_print(
1214 /*=========*/
1215  FILE* file);
1216 /**********************************************************************/
1218 UNIV_INTERN
1219 void
1220 os_aio_refresh_stats(void);
1221 /*======================*/
1222 
1223 #ifdef UNIV_DEBUG
1224 /**********************************************************************/
1227 UNIV_INTERN
1228 ibool
1229 os_aio_all_slots_free(void);
1230 /*=======================*/
1231 #endif /* UNIV_DEBUG */
1232 
1233 /*******************************************************************/
1236 UNIV_INTERN
1237 dberr_t
1239 /*===============*/
1240  const char* path,
1241  os_file_stat_t* stat_info,
1243  bool check_rw_perm);
1246 #if !defined(UNIV_HOTBACKUP)
1247 /*********************************************************************/
1251 UNIV_INTERN
1252 int
1254 /*========================*/
1255 #endif /* !UNIV_HOTBACKUP */
1256 
1257 
1258 #if defined(LINUX_NATIVE_AIO)
1259 /**************************************************************************
1260 This function is only used in Linux native asynchronous i/o.
1261 Waits for an aio operation to complete. This function is used to wait the
1262 for completed requests. The aio array of pending requests is divided
1263 into segments. The thread specifies which segment or slot it wants to wait
1264 for. NOTE: this function will also take care of freeing the aio slot,
1265 therefore no other thread is allowed to do the freeing!
1266 @return TRUE if the IO was successful */
1267 UNIV_INTERN
1268 ibool
1269 os_aio_linux_handle(
1270 /*================*/
1271  ulint global_seg,
1277  fil_node_t**message1,
1278  void** message2,
1282  ulint* type);
1283 #endif /* LINUX_NATIVE_AIO */
1284 
1285 #ifndef UNIV_NONINL
1286 #include "os0file.ic"
1287 #endif
1288 
1289 #endif