![]() |
MySQL 26.7.0
Source Code Documentation
|
The interface to the operating system file io. More...
#include "my_dbug.h"#include "my_io.h"#include "os/file.h"#include "os0atomic.h"#include "os0enc.h"#include <dirent.h>#include <sys/stat.h>#include <sys/statvfs.h>#include <time.h>#include <functional>#include <stack>#include "os0file.ic"Go to the source code of this file.
Classes | |
| struct | file::Block |
| Blocks for doing IO, used in the transparent compression and encryption code. More... | |
| struct | pfs_os_file_t |
| Common file descriptor for file IO instrumentation with PFS on windows and other platforms. More... | |
| class | IORequest |
| Types for AIO operations. More... | |
| struct | os_file_size_t |
| Sparse file size information. More... | |
| struct | os_file_stat_t |
| Struct used in fetching information of a file in a directory. More... | |
| struct | Access_permissions |
| Stores information about access modes to the resource permitted to the caller at the moment of checking them. More... | |
| class | Dir_Walker |
| Class to scan the directory hierarchy using a depth first scan. More... | |
| struct | Dir_Walker::Entry |
| Directory names for the depth first directory scan. More... | |
| class | SyncFileIO |
| Helper class for doing synchronous file IO. More... | |
Namespaces | |
| namespace | file |
Macros | |
| #define | OS_FILE_PREFIX "#" |
| Prefix all files and directory created under data directory with special string so that it never conflicts with MySQL schema directory. More... | |
| #define | OS_FILE_FROM_FD(fd) fd |
| Convert a C file descriptor to a native file handle. More... | |
| #define | OS_FD_FROM_FILE(file) file |
| C file descriptor from an existing native file handle. More... | |
| #define | OS_FILE_CLOSE_FD(fd) (os_file_close(fd) ? 0 : OS_FD_CLOSED) |
| Closes the file associated with C file descriptor fd. More... | |
| #define | PRINT_MASK_ELEMENT(flag) |
| #define | register_pfs_file_open_begin(state, locker, key, op, name, src_location) |
| #define | register_pfs_file_open_end(locker, file, result) |
| #define | register_pfs_file_rename_begin(state, locker, key, op, from, to, src_location) |
| #define | register_pfs_file_rename_end(locker, from, to, result) |
| #define | register_pfs_file_close_begin(state, locker, key, op, name, src_location) |
| #define | register_pfs_file_close_end(locker, result) |
| #define | register_pfs_file_io_begin(state, locker, file, count, op, src_location) |
| #define | register_pfs_file_io_end(locker, count) |
| #define | os_file_create(key, name, create, purpose, read_only, success) |
| #define | os_file_create_simple_no_error_handling(key, name, create_mode, access, success) |
| #define | os_file_create_simple_no_error_handling_with_umask(key, name, create_mode, access, umask, success) |
| #define | os_file_close_pfs(file) pfs_os_file_close_func(file, UT_LOCATION_HERE) |
| #define | os_aio(type, mode, name, file, buf, offset, n, callback) |
| #define | os_file_read_pfs(type, file_name, file, buf, offset, n) pfs_os_file_read_func(type, file_name, file, buf, offset, n, UT_LOCATION_HERE) |
| #define | os_file_read_first_page_pfs(type, file_name, file, buf, n_pages) |
| #define | os_file_copy_pfs(src, src_offset, dest, dest_offset, size) |
| #define | os_file_read_no_error_handling_pfs(type, file_name, file, buf, offset, n, o) |
| #define | os_file_read_no_error_handling_int_fd(type, file_name, file, buf, offset, n, o) |
| #define | os_file_write_pfs(type, name, file, buf, offset, n) pfs_os_file_write_func(type, name, file, buf, offset, n, UT_LOCATION_HERE) |
| #define | os_file_write_int_fd(type, name, file, buf, offset, n) |
| #define | os_file_flush_pfs(file) pfs_os_file_flush_func(file, UT_LOCATION_HERE) |
| #define | os_file_rename(key, oldpath, newpath) pfs_os_file_rename_func(key, oldpath, newpath, UT_LOCATION_HERE) |
| #define | os_file_delete(key, name) pfs_os_file_delete_func(key, name, UT_LOCATION_HERE) |
| #define | os_file_delete_if_exists(key, name, exist) pfs_os_file_delete_if_exists_func(key, name, exist, UT_LOCATION_HERE) |
| #define | os_file_close(file) os_file_close_pfs(file) |
| #define | os_file_read(type, file_name, file, buf, offset, n) os_file_read_pfs(type, file_name, file, buf, offset, n) |
| #define | os_file_read_first_page(type, file_name, file, buf, n_pages) os_file_read_first_page_pfs(type, file_name, file, buf, n_pages) |
| #define | os_file_flush(file) os_file_flush_pfs(file) |
| #define | os_file_write(type, name, file, buf, offset, n) os_file_write_pfs(type, name, file, buf, offset, n) |
| #define | os_file_copy(src, src_offset, dest, dest_offset, size) os_file_copy_pfs(src, src_offset, dest, dest_offset, size) |
| #define | os_file_read_no_error_handling(type, file_name, file, buf, offset, n, o) os_file_read_no_error_handling_pfs(type, file_name, file, buf, offset, n, o) |
Typedefs | |
| typedef uint64_t | os_offset_t |
| File offset in bytes. More... | |
| using | os_fd_t = int |
| Raw file handle. More... | |
| using | os_file_t = os_fd_t |
| File handle. More... | |
| typedef std::function< void(const char *path, const char *name)> | os_dir_cbk_t |
| Callback function type to be implemented by caller. More... | |
Enumerations | |
| enum | os_file_type_t { OS_FILE_TYPE_FAILED , OS_FILE_TYPE_NAME_TOO_LONG , OS_FILE_PERMISSION_ERROR , OS_FILE_TYPE_MISSING , OS_FILE_TYPE_UNKNOWN , OS_FILE_TYPE_FILE , OS_FILE_TYPE_DIR , OS_FILE_TYPE_LINK , OS_FILE_TYPE_BLOCK } |
| enum class | AIO_mode : size_t { NORMAL = 21 , IBUF = 22 } |
| Modes for aio operations. More... | |
Functions | |
| constexpr IORequest::Type | operator~ (const IORequest::Type type) |
| constexpr IORequest::Type | operator| (const IORequest::Type a, const IORequest::Type b) |
| constexpr IORequest::Type | operator& (const IORequest::Type a, const IORequest::Type b) |
| constexpr IORequest::Type & | operator|= (IORequest::Type &a, const IORequest::Type b) |
| constexpr IORequest::Type & | operator&= (IORequest::Type &a, const IORequest::Type b) |
| FILE * | os_file_create_tmpfile () |
| Create a temporary file. More... | |
| bool | os_file_create_directory (const char *pathname, bool fail_if_exists) |
| This function attempts to create a directory named pathname. More... | |
| bool | os_file_scan_directory (const char *path, os_dir_cbk_t scan_cbk, bool is_drop) |
| This function scans the contents of a directory and invokes the callback for each entry. More... | |
| pfs_os_file_t | os_file_create_simple_no_error_handling_func (const char *name, ulint create_mode, ulint access_type, mode_t umask, bool *success) |
| Clang on Windows warns about umask not found. More... | |
| void | os_file_set_nocache (int fd, const char *file_name, const char *operation_name, bool on_error_silent=false) |
| Tries to disable OS caching on an opened file descriptor. More... | |
| pfs_os_file_t | os_file_create_func (const char *name, ulint create_mode, ulint purpose, bool read_only, bool *success) |
| NOTE! Use the corresponding macro os_file_create(), not directly this function! Opens an existing file or creates a new. More... | |
| bool | os_file_delete_func (const char *name) |
| Deletes a file. More... | |
| bool | os_file_delete_if_exists_func (const char *name, bool *exist) |
| Deletes a file if it exists. More... | |
| bool | os_file_rename_func (const char *oldpath, const char *newpath) |
| NOTE! Use the corresponding macro os_file_rename(), not directly this function! Renames a file (can also move it to another directory). More... | |
| bool | os_file_close_func (os_file_t file) |
| NOTE! Use the corresponding macro os_file_close(), not directly this function! Closes a file handle. More... | |
| static pfs_os_file_t | pfs_os_file_create_simple_no_error_handling_func (mysql_pfs_key_t key, const char *name, ulint create_mode, ulint access_type, mode_t umask, bool *success, ut::Location src_location) |
| Clang on Windows warns about umask not found. More... | |
| static pfs_os_file_t | pfs_os_file_create_func (mysql_pfs_key_t key, const char *name, ulint create_mode, ulint purpose, bool read_only, bool *success, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_create(), not directly this function! A performance schema wrapper function for os_file_create(). More... | |
| static bool | pfs_os_file_close_func (pfs_os_file_t file, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_close(), not directly this function! A performance schema instrumented wrapper function for os_file_close(). More... | |
| static dberr_t | pfs_os_file_read_func (const IORequest &type, const char *file_name, pfs_os_file_t file, byte *buf, os_offset_t offset, ulint n, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_read(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read() which requests a synchronous read operation. More... | |
| static dberr_t | pfs_os_file_read_first_page_func (IORequest &type, const char *file_name, pfs_os_file_t file, byte *buf, page_no_t n_pages, ut::Location src_location) |
NOTE! Please use the corresponding macro os_file_read_first_page(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_first_page() which requests a synchronous read operation for first n_pages pages of the file, using the page size stored on the first page. More... | |
| static dberr_t | pfs_os_file_copy_func (pfs_os_file_t src, os_offset_t src_offset, pfs_os_file_t dest, os_offset_t dest_offset, uint size, ut::Location src_location) |
| copy data from one file to another file. More... | |
| static dberr_t | pfs_os_file_read_no_error_handling_func (IORequest &type, const char *file_name, pfs_os_file_t file, byte *buf, os_offset_t offset, ulint n, ulint *o, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_read_no_error_handling(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_func() which requests a synchronous read operation. More... | |
| static dberr_t | pfs_os_file_read_no_error_handling_int_fd_func (IORequest &type, const char *file_name, int file, byte *buf, os_offset_t offset, ulint n, ulint *o, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_read_no_error_handling_int_fd(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_int_fd_func() which requests a synchronous read operation on files with int type descriptors. More... | |
| static dberr_t | pfs_os_aio_func (IORequest &type, AIO_mode mode, const char *name, pfs_os_file_t file, byte *buf, os_offset_t offset, ulint n, std::function< void(dberr_t)> callback, ut::Location location) |
| NOTE! Please use the corresponding macro os_aio(), not directly this function! Performance schema wrapper function of os_aio() which requests an asynchronous I/O operation. More... | |
| static dberr_t | pfs_os_file_write_func (IORequest &type, const char *name, pfs_os_file_t file, const byte *buf, os_offset_t offset, ulint n, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_write(), not directly this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation. More... | |
| static dberr_t | pfs_os_file_write_int_fd_func (IORequest &type, const char *name, int file, const byte *buf, os_offset_t offset, ulint n, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_write(), not directly this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation on files with int type descriptors. More... | |
| static bool | pfs_os_file_flush_func (pfs_os_file_t file, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_flush(), not directly this function! This is the performance schema instrumented wrapper function for os_file_flush() which flushes the write buffers of a given file to the disk. More... | |
| static bool | pfs_os_file_rename_func (mysql_pfs_key_t key, const char *oldpath, const char *newpath, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_rename(), not directly this function! This is the performance schema instrumented wrapper function for os_file_rename() More... | |
| static bool | pfs_os_file_delete_func (mysql_pfs_key_t key, const char *name, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_delete(), not directly this function! This is the performance schema instrumented wrapper function for os_file_delete() More... | |
| static bool | pfs_os_file_delete_if_exists_func (mysql_pfs_key_t key, const char *name, bool *exist, ut::Location src_location) |
| NOTE! Please use the corresponding macro os_file_delete_if_exists(), not directly this function! This is the performance schema instrumented wrapper function for os_file_delete_if_exists() More... | |
| os_file_size_t | os_file_get_size (const char *filename) |
| Gets a file size. More... | |
| os_offset_t | os_file_get_size (pfs_os_file_t file) |
| Gets a file size. More... | |
| dberr_t | os_file_fill_range_with_zeros (const char *name, pfs_os_file_t file, os_offset_t offset, os_offset_t length, bool flush, bool force_raw_writes) |
| Write the specified number of zeros to a file from specific offset, if the end offset is beyond the end of file, the file will be resized to this offset. More... | |
| bool | os_file_set_eof (FILE *file) |
| Truncates a file at its current position. More... | |
| bool | os_file_truncate (const char *pathname, pfs_os_file_t file, os_offset_t size) |
| Truncates a file to a specified size in bytes. More... | |
| bool | os_file_seek (const char *pathname, os_file_t file, os_offset_t offset) |
| Set read/write position of a file handle to specific offset. More... | |
| bool | os_file_flush_func (os_file_t file) |
| NOTE! Use the corresponding macro os_file_flush(), not directly this function! Flushes the write buffers of a given file to the disk. More... | |
| ulint | os_file_get_and_log_last_error () |
| Retrieves the last error number if an OS error occurs in a file IO function. More... | |
| void | os_file_log_last_error () |
| Logs the last error number if an OS error occurs in a file IO function. More... | |
| dberr_t | os_file_read_func (const IORequest &type, const char *file_name, os_file_t file, byte *buf, os_offset_t offset, ulint n) |
| NOTE! Use the corresponding macro os_file_read(), not directly this function! Requests a synchronous read operation of page 0 of IBD file. More... | |
| dberr_t | os_file_read_first_page_func (IORequest &type, const char *file_name, os_file_t file, byte *buf, page_no_t n_pages) |
NOTE! Use the corresponding macro os_file_read_first_page(), not directly this function! Requests a synchronous read operation for first n_pages pages of the file, using the page size stored on the first page. More... | |
| dberr_t | os_file_copy_func (os_file_t src_file, os_offset_t src_offset, os_file_t dest_file, os_offset_t dest_offset, uint size) |
| Copy data from one file to another file. More... | |
| void | os_file_read_string (FILE *file, char *str, ulint size) |
| Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str. More... | |
| dberr_t | os_file_read_no_error_handling_func (IORequest &type, const char *file_name, os_file_t file, byte *buf, os_offset_t offset, ulint n, ulint *o) |
| NOTE! Use the corresponding macro os_file_read_no_error_handling(), not directly this function! Requests a synchronous positioned read operation. More... | |
| dberr_t | os_file_write_func (IORequest &type, const char *name, os_file_t file, const byte *buf, os_offset_t offset, ulint n) |
| NOTE! Use the corresponding macro os_file_write(), not directly this function! Requests a synchronous write operation. More... | |
| bool | os_file_exists (const char *path) |
| Check the existence and usefulness of a given path. More... | |
| os_file_type_t | os_file_type (const char *path) |
| Checks the existence and type (dir, file, link, unknown) of given path. More... | |
| bool | os_file_status_is_conclusive (os_file_type_t type) |
| A helper method that usually is feed the file_type returned by the os_file_type() method. More... | |
| bool | os_file_exists (os_file_type_t type) |
| A helper method that usually is feed the file_type returned by the os_file_type() method. More... | |
| bool | os_file_is_missing (os_file_type_t type) |
| A helper method that usually is feed the file_type returned by the os_file_type() method. More... | |
| dberr_t | os_file_create_subdirs_if_needed (const char *path) |
| Create all missing subdirectories along the given path. More... | |
| void | os_create_block_cache () |
| Creates and initializes block_cache. More... | |
| bool | os_aio_init (ulint n_readers, ulint n_writers) |
| Initializes the asynchronous io system. More... | |
| void | os_aio_start_threads () |
| Starts one thread for each segment created in os_aio_init. More... | |
| void | os_aio_free () |
| Frees the asynchronous io system. More... | |
| dberr_t | os_aio_func (IORequest &type, AIO_mode aio_mode, const char *name, pfs_os_file_t file, byte *buf, os_offset_t offset, ulint n, std::function< void(dberr_t)> callback) |
| NOTE! Use the corresponding macro os_aio(), not directly this function! Requests an asynchronous i/o operation. More... | |
| void | os_aio_wake_all_threads_at_shutdown () |
| Wakes up all async i/o threads so that they know to exit themselves in shutdown. More... | |
| void | os_aio_wait_until_no_pending_writes () |
| Waits until there are no pending writes in os_aio_write_array. More... | |
| void | os_aio_simulated_wake_handler_threads () |
| Wakes up simulated aio i/o-handler threads if they have something to do. More... | |
| void | os_aio_simulated_put_read_threads_to_sleep () |
| This function can be called if one wants to post a batch of reads and prefers an i/o-handler thread to handle them all at once later. More... | |
| dberr_t | os_aio_handler (ulint segment, std::function< void(dberr_t)> &callback, IORequest *request) |
| Waits for an AIO operation to complete. More... | |
| void | os_aio_print (FILE *file) |
| Prints info of the aio arrays. More... | |
| void | os_aio_refresh_stats () |
| Refreshes the statistics used to print per-second averages. More... | |
| bool | os_aio_all_slots_free () |
| Checks that all slots in the system have been freed, that is, there are no pending io operations. More... | |
| void | os_aio_print_pending_io (FILE *file) |
| Prints all pending IO. More... | |
| dberr_t | os_get_free_space (const char *path, uint64_t &free_space) |
| Get available free space on disk. More... | |
| Access_permissions | os_file_check_access (const char *path, bool is_raw_device) |
| This function checks if we have read and/or write permissions at the time of checking. More... | |
| dberr_t | os_file_get_status (const char *path, os_file_stat_t *stat_info) |
| This function returns information about the specified file. More... | |
| bool | os_file_check_mode (const char *name, bool is_raw_device, bool read_only) |
| Check if a file can be opened in read-write mode. More... | |
| char * | innobase_mysql_tmpdir () |
| return any of the tmpdir path More... | |
| os_fd_t | innobase_mysql_tmpfile (const char *path) |
| Creates a temporary file in the location specified by the parameter path. More... | |
| ulint | os_file_compressed_page_size (const byte *buf) |
| If it is a compressed page return the compressed page data + footer size. More... | |
| void | os_file_set_umask (mode_t umask) |
| Set the global file create umask. More... | |
| dberr_t | os_file_punch_hole (os_file_t fh, os_offset_t off, os_offset_t len) |
| Free storage space associated with a section of the file. More... | |
| dberr_t | os_file_decompress_page (bool dblwr_read, byte *src, byte *dst, ulint dst_len) |
| Decompress the page data contents. More... | |
| byte * | os_file_compress_page (Compression compression, ulint block_size, byte *src, ulint src_len, byte *dst, ulint *dst_len) |
| Compress a data page. More... | |
| bool | os_is_o_direct_supported () |
| Determine if O_DIRECT is supported. More... | |
| file::Block * | os_alloc_block () noexcept |
| Allocate a page for sync IO. More... | |
| byte * | os_block_get_frame (const file::Block *block) noexcept |
| Get the sector aligned frame pointer. More... | |
| void | os_free_block (file::Block *block) noexcept |
| Free a page after sync IO. More... | |
| file::Block * | os_file_encrypt_page (const IORequest &type, byte *&buf, ulint n) |
| Encrypt a page content when write it to disk. More... | |
| file::Block * | os_file_compress_page (IORequest &type, byte *&buf, ulint *n) |
| Allocate the buffer for IO on a transparently compressed table. More... | |
| dberr_t | os_file_write_retry (IORequest &type, const char *name, pfs_os_file_t file, const byte *buf, os_offset_t offset, ulint n) |
| This is a wrapper function for the os_file_write() function call. More... | |
The interface to the operating system file io.
Created 10/21/1995 Heikki Tuuri
| #define OS_FD_FROM_FILE | ( | file | ) | file |
C file descriptor from an existing native file handle.
| [in] | file | native file handle |
| #define os_file_close | ( | file | ) | os_file_close_pfs(file) |
| #define OS_FILE_CLOSE_FD | ( | fd | ) | (os_file_close(fd) ? 0 : OS_FD_CLOSED) |
Closes the file associated with C file descriptor fd.
| [in] | fd | C file descriptor |
| #define os_file_close_pfs | ( | file | ) | pfs_os_file_close_func(file, UT_LOCATION_HERE) |
| #define os_file_copy | ( | src, | |
| src_offset, | |||
| dest, | |||
| dest_offset, | |||
| size | |||
| ) | os_file_copy_pfs(src, src_offset, dest, dest_offset, size) |
| #define os_file_copy_pfs | ( | src, | |
| src_offset, | |||
| dest, | |||
| dest_offset, | |||
| size | |||
| ) |
| #define os_file_create_simple_no_error_handling_with_umask | ( | key, | |
| name, | |||
| create_mode, | |||
| access, | |||
| umask, | |||
| success | |||
| ) |
| #define os_file_delete | ( | key, | |
| name | |||
| ) | pfs_os_file_delete_func(key, name, UT_LOCATION_HERE) |
| #define os_file_delete_if_exists | ( | key, | |
| name, | |||
| exist | |||
| ) | pfs_os_file_delete_if_exists_func(key, name, exist, UT_LOCATION_HERE) |
| #define os_file_flush | ( | file | ) | os_file_flush_pfs(file) |
| #define os_file_flush_pfs | ( | file | ) | pfs_os_file_flush_func(file, UT_LOCATION_HERE) |
| #define OS_FILE_FROM_FD | ( | fd | ) | fd |
Convert a C file descriptor to a native file handle.
| fd | file descriptor |
| #define OS_FILE_PREFIX "#" |
Prefix all files and directory created under data directory with special string so that it never conflicts with MySQL schema directory.
| #define os_file_read | ( | type, | |
| file_name, | |||
| file, | |||
| buf, | |||
| offset, | |||
| n | |||
| ) | os_file_read_pfs(type, file_name, file, buf, offset, n) |
| #define os_file_read_first_page | ( | type, | |
| file_name, | |||
| file, | |||
| buf, | |||
| n_pages | |||
| ) | os_file_read_first_page_pfs(type, file_name, file, buf, n_pages) |
| #define os_file_read_no_error_handling | ( | type, | |
| file_name, | |||
| file, | |||
| buf, | |||
| offset, | |||
| n, | |||
| o | |||
| ) | os_file_read_no_error_handling_pfs(type, file_name, file, buf, offset, n, o) |
| #define os_file_read_pfs | ( | type, | |
| file_name, | |||
| file, | |||
| buf, | |||
| offset, | |||
| n | |||
| ) | pfs_os_file_read_func(type, file_name, file, buf, offset, n, UT_LOCATION_HERE) |
| #define os_file_rename | ( | key, | |
| oldpath, | |||
| newpath | |||
| ) | pfs_os_file_rename_func(key, oldpath, newpath, UT_LOCATION_HERE) |
| #define os_file_write | ( | type, | |
| name, | |||
| file, | |||
| buf, | |||
| offset, | |||
| n | |||
| ) | os_file_write_pfs(type, name, file, buf, offset, n) |
| #define os_file_write_pfs | ( | type, | |
| name, | |||
| file, | |||
| buf, | |||
| offset, | |||
| n | |||
| ) | pfs_os_file_write_func(type, name, file, buf, offset, n, UT_LOCATION_HERE) |
| #define register_pfs_file_close_end | ( | locker, | |
| result | |||
| ) |
| #define register_pfs_file_io_begin | ( | state, | |
| locker, | |||
| file, | |||
| count, | |||
| op, | |||
| src_location | |||
| ) |
| #define register_pfs_file_io_end | ( | locker, | |
| count | |||
| ) |
| #define register_pfs_file_open_end | ( | locker, | |
| file, | |||
| result | |||
| ) |
| #define register_pfs_file_rename_begin | ( | state, | |
| locker, | |||
| key, | |||
| op, | |||
| from, | |||
| to, | |||
| src_location | |||
| ) |
| #define register_pfs_file_rename_end | ( | locker, | |
| from, | |||
| to, | |||
| result | |||
| ) |
| typedef std::function<void(const char *path, const char *name)> os_dir_cbk_t |
Callback function type to be implemented by caller.
It is called for each entry in directory.
| [in] | path | path to the file |
| [in] | name | name of the file |
| using os_fd_t = int |
Raw file handle.
| typedef uint64_t os_offset_t |
File offset in bytes.
|
strong |
| enum os_file_create_t |
Options for os_file_create_func.
| enum os_file_type_t |
| char * innobase_mysql_tmpdir | ( | ) |
return any of the tmpdir path
| os_fd_t innobase_mysql_tmpfile | ( | const char * | path | ) |
Creates a temporary file in the location specified by the parameter path.
If the path is NULL, then it will be created in –tmpdir.
| [in] | path | location for creating temporary file |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
| bool os_aio_all_slots_free | ( | ) |
Checks that all slots in the system have been freed, that is, there are no pending io operations.
| void os_aio_free | ( | ) |
Frees the asynchronous io system.
| dberr_t os_aio_func | ( | IORequest & | type, |
| AIO_mode | aio_mode, | ||
| const char * | name, | ||
| pfs_os_file_t | file, | ||
| byte * | buf, | ||
| os_offset_t | offset, | ||
| ulint | n, | ||
| std::function< void(dberr_t)> | callback | ||
| ) |
NOTE! Use the corresponding macro os_aio(), not directly this function! Requests an asynchronous i/o operation.
| [in] | type | IO request context |
| [in] | aio_mode | IO mode |
| [in] | name | Name of the file or path as NUL terminated string |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | how many bytes to read or write; this must not cross a file boundary; in AIO this must be a block size multiple |
| [in] | callback | A lambda to be called when the result of this operation is known. It may be a success if the read or write succeeded or a subset of dberr_t errors if the write or read could not be executed or if it failed. It will be executed asynchronously from another thread, before or after this call returns. |
| dberr_t os_aio_handler | ( | ulint | segment, |
| std::function< void(dberr_t)> & | callback, | ||
| IORequest * | request | ||
| ) |
Waits for an AIO operation to complete.
This function is used to wait the for completed requests. After the IO completes this method returns the IO metadata and callback specified when issuing the IO, to allow the IO completion routines to be called. It may return before any AIO completes, but only in case the InnoDB is shutting down. In such case the DB_SHUTTING_DOWN is returned. The AIO array of pending requests is divided into segments. The thread specifies which segment or slot it wants to wait for. NOTE: this function will also take care of freeing the AIO slot, therefore no other thread is allowed to do the freeing!
| [in] | segment | The number of the segment in the AIO arrays to wait for; segment 0 is the ibuf I/O thread, then follow the non-ibuf read threads, and as the last are the non-ibuf write threads |
| [out] | callback | The callback specified when issuing the AIO operation. It should be called as part of IO completion routines. It will not be set if the returned error code is DB_SHUTTING_DOWN. |
| [out] | request | The IO request metadata specified when issuing the AIO operation. It will not be set if the returned error code is DB_SHUTTING_DOWN. |
Initializes the asynchronous io system.
Creates an array for ibuf i/o (if not in read-only mode). Also creates one array each for read and write where each array is divided logically into n_readers and n_writers respectively. The caller must create an i/o handler thread for each segment in these arrays by calling os_aio_start_threads().
| [in] | n_readers | number of reader threads |
| [in] | n_writers | number of writer threads |
| void os_aio_print | ( | FILE * | file | ) |
Prints info of the aio arrays.
| [in,out] | file | file where to print |
| void os_aio_print_pending_io | ( | FILE * | file | ) |
Prints all pending IO.
| [in] | file | File where to print |
| void os_aio_refresh_stats | ( | ) |
Refreshes the statistics used to print per-second averages.
| void os_aio_simulated_put_read_threads_to_sleep | ( | ) |
This function can be called if one wants to post a batch of reads and prefers an i/o-handler thread to handle them all at once later.
You must call os_aio_simulated_wake_handler_threads later to ensure the threads are not left sleeping!
| void os_aio_simulated_wake_handler_threads | ( | ) |
Wakes up simulated aio i/o-handler threads if they have something to do.
| void os_aio_start_threads | ( | ) |
Starts one thread for each segment created in os_aio_init.
| void os_aio_wait_until_no_pending_writes | ( | ) |
Waits until there are no pending writes in os_aio_write_array.
There can be other, synchronous, pending writes.
Waits until there are no pending writes in os_aio_write_array.
There can be other, synchronous, pending writes.
| void os_aio_wake_all_threads_at_shutdown | ( | ) |
Wakes up all async i/o threads so that they know to exit themselves in shutdown.
|
noexcept |
Allocate a page for sync IO.
|
noexcept |
Get the sector aligned frame pointer.
| [in] | block | the memory block containing the page frame. |
| void os_create_block_cache | ( | ) |
Creates and initializes block_cache.
Creates array of MAX_BLOCKS and allocates the memory in each block to hold UNIV_PAGE_SIZE bytes of data.
This function is called by InnoDB during srv_start(). It is also called by MEB while applying the redo logs on TDE tablespaces, the "Blocks" allocated in this block_cache are used to hold the decrypted page data.
| Access_permissions os_file_check_access | ( | const char * | path, |
| bool | is_raw_device | ||
| ) |
This function checks if we have read and/or write permissions at the time of checking.
These are not just the FS-related file permissions, as they are not enough in case the file is locked for read and/or write.
| [in] | path | pathname of the file |
| [in] | is_raw_device | true if the path is specified to a raw device. |
| bool os_file_check_mode | ( | const char * | name, |
| bool | is_raw_device, | ||
| bool | read_only | ||
| ) |
Check if a file can be opened in read-write mode.
| [in] | name | filename to check |
| [in] | is_raw_device | true if the path is specified to a raw device. |
| [in] | read_only | true if check for read-only mode only |
| true | if file can be opened in the specified mode (rw or ro); or file does not exist |
| false | if file exists and can't be opened in the specified mode |
| bool os_file_close_func | ( | os_file_t | file | ) |
NOTE! Use the corresponding macro os_file_close(), not directly this function! Closes a file handle.
In case of error, error number can be retrieved with os_file_get_and_log_last_error.
| [in] | file | Handle to a file |
| byte * os_file_compress_page | ( | Compression | compression, |
| ulint | block_size, | ||
| byte * | src, | ||
| ulint | src_len, | ||
| byte * | dst, | ||
| ulint * | dst_len | ||
| ) |
Compress a data page.
| [in] | compression | Compression algorithm |
| [in] | block_size | File system block size |
| [in] | src | Source contents to compress |
| [in] | src_len | Length in bytes of the source |
| [out] | dst | Compressed page contents |
| [out] | dst_len | Length in bytes of dst contents |
| file::Block * os_file_compress_page | ( | IORequest & | type, |
| byte *& | buf, | ||
| ulint * | n | ||
| ) |
Allocate the buffer for IO on a transparently compressed table.
| [in] | type | IO flags |
| [out] | buf | buffer to read or write |
| [in,out] | n | number of bytes to read/write, starting from offset |
If it is a compressed page return the compressed page data + footer size.
| [in] | buf | Buffer to check, must include header + 10 bytes |
| dberr_t os_file_copy_func | ( | os_file_t | src_file, |
| os_offset_t | src_offset, | ||
| os_file_t | dest_file, | ||
| os_offset_t | dest_offset, | ||
| uint | size | ||
| ) |
Copy data from one file to another file.
Data is read/written at current file offset.
| [in] | src_file | file handle to copy from |
| [in] | src_offset | offset to copy from |
| [in] | dest_file | file handle to copy to |
| [in] | dest_offset | offset to copy to |
| [in] | size | number of bytes to copy |
| bool os_file_create_directory | ( | const char * | pathname, |
| bool | fail_if_exists | ||
| ) |
This function attempts to create a directory named pathname.
The new directory gets default permissions. On Unix the permissions are (0770 & ~umask). If the directory exists already, nothing is done and the call succeeds, unless the fail_if_exists arguments is true. If another error occurs, such as a permission error, this does not crash, but reports the error and returns false.
| [in] | pathname | directory name as null-terminated string |
| [in] | fail_if_exists | if true, pre-existing directory is treated as an error. |
| pfs_os_file_t os_file_create_func | ( | const char * | name, |
| ulint | create_mode, | ||
| ulint | purpose, | ||
| bool | read_only, | ||
| bool * | success | ||
| ) |
NOTE! Use the corresponding macro os_file_create(), not directly this function! Opens an existing file or creates a new.
| [in] | name | name of the file or path as a null-terminated string |
| [in] | create_mode | create mode |
| [in] | purpose | OS_DATA_FILE, OS_LOG_FILE etc. |
| [in] | read_only | if true read only mode checks are enforced |
| [out] | success | true if succeeded |
| pfs_os_file_t os_file_create_simple_no_error_handling_func | ( | const char * | name, |
| ulint | create_mode, | ||
| ulint | access_type, | ||
| mode_t | umask, | ||
| bool * | success | ||
| ) |
Clang on Windows warns about umask not found.
NOTE! Use the corresponding macro os_file_create_simple_no_error_handling(), not directly this function! A simple function to open or create a file.
| [in] | name | name of the file or path as a null-terminated string |
| [in] | create_mode | create mode |
| [in] | access_type | 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 |
| [in] | umask | UNIX access permission to be set when creating a file. Use os_umask_default to use global default umask. |
| [out] | success | true if succeeded |
| dberr_t os_file_create_subdirs_if_needed | ( | const char * | path | ) |
Create all missing subdirectories along the given path.
Create all missing subdirectories along the given path.
| [in] | path | Path name |
| FILE * os_file_create_tmpfile | ( | ) |
Create a temporary file.
This function is like tmpfile(3). It will create the file in the MySQL server configuration parameter (–tmpdir).
Decompress the page data contents.
Page type must be FIL_PAGE_COMPRESSED, if not then the source contents are left unchanged and DB_SUCCESS is returned.
| [in] | dblwr_read | true of double write recovery in progress |
| [in,out] | src | Data read from disk, decompressed data will be copied to this page |
| [in,out] | dst | Scratch area to use for decompression or nullptr. |
| [in] | dst_len | If dst is valid, then size of the scratch area in bytes |
| bool os_file_delete_func | ( | const char * | name | ) |
Deletes a file.
The file has to be closed before calling this.
| [in] | name | file path as a null-terminated string |
| bool os_file_delete_if_exists_func | ( | const char * | name, |
| bool * | exist | ||
| ) |
Deletes a file if it exists.
The file has to be closed before calling this.
| [in] | name | file path as a null-terminated string |
| [out] | exist | indicate if file pre-exist |
| file::Block * os_file_encrypt_page | ( | const IORequest & | type, |
| byte *& | buf, | ||
| ulint | n | ||
| ) |
Encrypt a page content when write it to disk.
| [in] | type | IO flags |
| [out] | buf | buffer to read or write |
| [in] | n | number of bytes to read/write, starting from offset |
| bool os_file_exists | ( | const char * | path | ) |
Check the existence and usefulness of a given path.
| [in] | path | path name |
| true | if the path definitely exists and can be used |
| false | if the path does not exist or if the path is unusable due to access or other issue |
| bool os_file_exists | ( | os_file_type_t | type | ) |
A helper method that usually is feed the file_type returned by the os_file_type() method.
It indicates that file exists and there are no access, invalid path or other issues.
| type | OS file type |
| dberr_t os_file_fill_range_with_zeros | ( | const char * | name, |
| pfs_os_file_t | file, | ||
| os_offset_t | offset, | ||
| os_offset_t | length, | ||
| bool | flush, | ||
| bool | force_raw_writes | ||
| ) |
Write the specified number of zeros to a file from specific offset, if the end offset is beyond the end of file, the file will be resized to this offset.
If the file was or might have been opened in unbuffered mode, then the offset and length must be aligned to UNIV_SECTOR_SIZE, and user should ensure these restriction hold.
| [in] | name | name of the file or path as a null-terminated string |
| [in] | file | handle to the file |
| [in] | offset | file offset from which to start writing zeros |
| [in] | length | number of bytes to zero |
| [in] | flush | flush file periodically if os_fsync_threshold is enabled or after the write is complete, to sync the range written and the file size metadata. |
| [in] | force_raw_writes | Forces to use regular write calls to clear the range. The fallocate is still used, on systems that support it, as it has a side-effect of keeping OS from over-allocating additional space for the file as it grows. That is, on systems that do not support fallocate, this flag has no effect. |
| bool os_file_flush_func | ( | os_file_t | file | ) |
NOTE! Use the corresponding macro os_file_flush(), not directly this function! Flushes the write buffers of a given file to the disk.
| [in] | file | handle to a file |
| ulint os_file_get_and_log_last_error | ( | ) |
Retrieves the last error number if an OS error occurs in a file IO function.
The number should be retrieved before any other OS calls (because they may overwrite the error number). If the number is not known to this program, the OS error number + 100 is returned. The error will also be logged to the Server log.
| os_file_size_t os_file_get_size | ( | const char * | filename | ) |
Gets a file size.
| [in] | filename | Full path to the filename to check |
| os_offset_t os_file_get_size | ( | pfs_os_file_t | file | ) |
Gets a file size.
| [in] | file | Handle to a file |
| dberr_t os_file_get_status | ( | const char * | path, |
| os_file_stat_t * | stat_info | ||
| ) |
This function returns information about the specified file.
| [in] | path | pathname of the file |
| [out] | stat_info | information of a file in a directory |
| bool os_file_is_missing | ( | os_file_type_t | type | ) |
A helper method that usually is feed the file_type returned by the os_file_type() method.
It indicates that file is definitely missing.
| type | OS file type |
| void os_file_log_last_error | ( | ) |
Logs the last error number if an OS error occurs in a file IO function.
The number should be retrieved before any other OS calls (because they may overwrite the error number). The error will be logged to the Server log.
| dberr_t os_file_punch_hole | ( | os_file_t | fh, |
| os_offset_t | off, | ||
| os_offset_t | len | ||
| ) |
Free storage space associated with a section of the file.
| [in] | fh | Open file handle |
| [in] | off | Starting offset (SEEK_SET) |
| [in] | len | Size of the hole |
| dberr_t os_file_read_first_page_func | ( | IORequest & | type, |
| const char * | file_name, | ||
| os_file_t | file, | ||
| byte * | buf, | ||
| page_no_t | n_pages | ||
| ) |
NOTE! Use the corresponding macro os_file_read_first_page(), not directly this function! Requests a synchronous read operation for first n_pages pages of the file, using the page size stored on the first page.
It does not uncompress nor decrypt any pages.
| [in,out] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [in,out] | buf | Buffer where to read data to. It must be aligned to OS device block size, it should be safe to use 4KB alignment. It must have length of at least UNIV_PAGE_SIZE_MAX * n_pages. |
| [in] | n_pages | How many pages to read. |
| dberr_t os_file_read_func | ( | const IORequest & | type, |
| const char * | file_name, | ||
| os_file_t | file, | ||
| byte * | buf, | ||
| os_offset_t | offset, | ||
| ulint | n | ||
| ) |
NOTE! Use the corresponding macro os_file_read(), not directly this function! Requests a synchronous read operation of page 0 of IBD file.
| [in] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| dberr_t os_file_read_no_error_handling_func | ( | IORequest & | type, |
| const char * | file_name, | ||
| os_file_t | file, | ||
| byte * | buf, | ||
| os_offset_t | offset, | ||
| ulint | n, | ||
| ulint * | o | ||
| ) |
NOTE! Use the corresponding macro os_file_read_no_error_handling(), not directly this function! Requests a synchronous positioned read operation.
This function does not do any error handling. In case of error it returns false.
| [in] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [out] | o | number of bytes actually read |
| void os_file_read_string | ( | FILE * | file, |
| char * | str, | ||
| ulint | size | ||
| ) |
Rewind file to its start, read at most size - 1 bytes from it to str, and NUL-terminate str.
All errors are silently ignored. This function is mostly meant to be used with temporary files.
| [in,out] | file | File to read from |
| [in,out] | str | Buffer where to read |
| [in] | size | Size of buffer |
| bool os_file_rename_func | ( | const char * | oldpath, |
| const char * | newpath | ||
| ) |
NOTE! Use the corresponding macro os_file_rename(), not directly this function! Renames a file (can also move it to another directory).
It is safest that the file is closed before calling this function.
| [in] | oldpath | old file path as a null-terminated string |
| [in] | newpath | new file path |
| bool os_file_scan_directory | ( | const char * | path, |
| os_dir_cbk_t | scan_cbk, | ||
| bool | is_drop | ||
| ) |
This function scans the contents of a directory and invokes the callback for each entry.
| [in] | path | directory name as null-terminated string |
| [in] | scan_cbk | use callback to be called for each entry |
| [in] | is_drop | attempt to drop the directory after scan |
| bool os_file_seek | ( | const char * | pathname, |
| os_file_t | file, | ||
| os_offset_t | offset | ||
| ) |
Set read/write position of a file handle to specific offset.
| [in] | pathname | file path |
| [in] | file | file handle |
| [in] | offset | read/write offset |
| bool os_file_set_eof | ( | FILE * | file | ) |
Truncates a file at its current position.
| [in,out] | file | file to be truncated |
| file | in: file to be truncated |
| void os_file_set_nocache | ( | int | fd, |
| const char * | file_name, | ||
| const char * | operation_name, | ||
| bool | on_error_silent = false |
||
| ) |
Tries to disable OS caching on an opened file descriptor.
| [in] | fd | file descriptor to alter |
| [in] | file_name | file name, used in the diagnostic message |
| [in] | operation_name | "open" or "create"; used in the diagnostic message |
| [in] | on_error_silent | if true then don't print any message to the log |
| void os_file_set_umask | ( | mode_t | umask | ) |
Set the global file create umask.
This value is to be set once, at startup and never modified.
| [in] | umask | The umask to use for all InnoDB file creation. |
| bool os_file_status_is_conclusive | ( | os_file_type_t | type | ) |
A helper method that usually is feed the file_type returned by the os_file_type() method.
It concludes the file status as following :
| type | OS file type |
| bool os_file_truncate | ( | const char * | pathname, |
| pfs_os_file_t | file, | ||
| os_offset_t | size | ||
| ) |
Truncates a file to a specified size in bytes.
Do nothing if the size to preserve is greater or equal to the current size of the file.
| [in] | pathname | file path |
| [in] | file | file to be truncated |
| [in] | size | size to preserve in bytes |
| os_file_type_t os_file_type | ( | const char * | path | ) |
Checks the existence and type (dir, file, link, unknown) of given path.
Might fail in various ways (path might be too long, io might fail, access could be blocked etc). Usually the file type is fed to the following helper methods:
| [in] | path | pathname of the file |
| dberr_t os_file_write_func | ( | IORequest & | type, |
| const char * | name, | ||
| os_file_t | file, | ||
| const byte * | buf, | ||
| os_offset_t | offset, | ||
| ulint | n | ||
| ) |
NOTE! Use the corresponding macro os_file_write(), not directly this function! Requests a synchronous write operation.
| [in,out] | type | IO request context |
| [in] | name | name of the file or path as a null-terminated string |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| dberr_t os_file_write_retry | ( | IORequest & | type, |
| const char * | name, | ||
| pfs_os_file_t | file, | ||
| const byte * | buf, | ||
| os_offset_t | offset, | ||
| ulint | n | ||
| ) |
This is a wrapper function for the os_file_write() function call.
The purpose of this wrapper function is to retry on i/o error. On I/O error (perhaps because of disk full situation) keep retrying the write operation till it succeeds.
| [in] | type | IO flags |
| [in] | name | name of the file or path as a null-terminated string |
| [in] | file | handle to an open file |
| [out] | buf | buffer from which to write |
| [in] | offset | file offset from the start where to read |
| [in] | n | number of bytes to read, starting from offset |
|
noexcept |
Free a page after sync IO.
| [in,out] | block | The block to free/release |
| dberr_t os_get_free_space | ( | const char * | path, |
| uint64_t & | free_space | ||
| ) |
Get available free space on disk.
| [in] | path | pathname of a directory or file in disk |
| [out] | free_space | free space available in bytes |
| bool os_is_o_direct_supported | ( | ) |
Determine if O_DIRECT is supported.
| true | if O_DIRECT is supported. |
| false | if O_DIRECT is not supported. |
|
inlinestatic |
NOTE! Please use the corresponding macro os_aio(), not directly this function! Performance schema wrapper function of os_aio() which requests an asynchronous I/O operation.
| [in] | type | IO request context |
| [in] | mode | IO mode |
| [in] | name | Name of the file or path as NUL terminated string |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | how many bytes to read or write; this must not cross a file boundary; in AIO this must be a block size multiple |
| [in] | callback | A lambda to be called when the result of this operation is known. It may be a success if the read or write succeeded or a subset of dberr_t errors if the write or read could not be executed or if it failed. It will be executed asynchronously from another thread, before or after this call returns. |
| [in] | location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_close(), not directly this function! A performance schema instrumented wrapper function for os_file_close().
| [in] | file | handle to a file |
| [in] | src_location | location where func invoked |
|
inlinestatic |
copy data from one file to another file.
Data is read/written at current file offset.
| [in] | src | file handle to copy from |
| [in] | src_offset | offset to copy from |
| [in] | dest | file handle to copy to |
| [in] | dest_offset | offset to copy to |
| [in] | size | number of bytes to copy |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_create(), not directly this function! A performance schema wrapper function for os_file_create().
Add instrumentation to monitor file creation/open.
| [in] | key | Performance Schema Key |
| [in] | name | name of the file or path as a null-terminated string |
| [in] | create_mode | create mode |
| [in] | purpose | OS_DATA_FILE, OS_LOG_FILE etc. |
| [in] | read_only | if true read only mode checks are enforced |
| [out] | success | true if succeeded |
| [in] | src_location | location where func invoked |
|
inlinestatic |
Clang on Windows warns about umask not found.
NOTE! Please use the corresponding macro os_file_create_simple_no_error_handling(), not directly this function! A performance schema instrumented wrapper function for os_file_create_simple_no_error_handling(). Add instrumentation to monitor file creation/open.
| [in] | key | Performance Schema Key |
| [in] | name | name of the file or path as a null-terminated string |
| [in] | create_mode | create mode |
| [in] | access_type | 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 |
| [in] | umask | UNIX access permission to be set when creating a file. Use os_umask_default to use global default umask. |
| [out] | success | true if succeeded |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_delete(), not directly this function! This is the performance schema instrumented wrapper function for os_file_delete()
| [in] | key | Performance Schema Key |
| [in] | name | old file path as a null-terminated string |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_delete_if_exists(), not directly this function! This is the performance schema instrumented wrapper function for os_file_delete_if_exists()
| [in] | key | Performance Schema Key |
| [in] | name | old file path as a null-terminated string |
| [in] | exist | indicate if file pre-exist |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_flush(), not directly this function! This is the performance schema instrumented wrapper function for os_file_flush() which flushes the write buffers of a given file to the disk.
Flushes the write buffers of a given file to the disk.
| [in] | file | Open file handle |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_read_first_page(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_first_page() which requests a synchronous read operation for first n_pages pages of the file, using the page size stored on the first page.
It does not uncompress nor decrypt any pages.
| [in,out] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [in,out] | buf | Buffer where to read data to. It must be aligned to OS device block size, it should be safe to use 4KB alignment. It must have length of at least UNIV_PAGE_SIZE_MAX * n_pages. |
| [in] | n_pages | How many pages to read. |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_read(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read() which requests a synchronous read operation.
| [in,out] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_read_no_error_handling(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_func() which requests a synchronous read operation.
| [in,out] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [out] | o | number of bytes actually read |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_read_no_error_handling_int_fd(), not directly this function! This is the performance schema instrumented wrapper function for os_file_read_no_error_handling_int_fd_func() which requests a synchronous read operation on files with int type descriptors.
| [in,out] | type | IO request context |
| [in] | file_name | file name |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [out] | o | number of bytes actually read |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_rename(), not directly this function! This is the performance schema instrumented wrapper function for os_file_rename()
| [in] | key | Performance Schema Key |
| [in] | oldpath | old file path as a null-terminated string |
| [in] | newpath | new file path |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_write(), not directly this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation.
| [in,out] | type | IO request context |
| [in] | name | Name of the file or path as NUL terminated string |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [in] | src_location | location where func invoked |
|
inlinestatic |
NOTE! Please use the corresponding macro os_file_write(), not directly this function! This is the performance schema instrumented wrapper function for os_file_write() which requests a synchronous write operation on files with int type descriptors.
| [in,out] | type | IO request context |
| [in] | name | Name of the file or path as NUL terminated string |
| [in] | file | Open file handle |
| [out] | buf | buffer where to read |
| [in] | offset | file offset where to read |
| [in] | n | number of bytes to read |
| [in] | src_location | location where func invoked |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
extern |
|
constexpr |
Number of retries for partial I/O's.
|
static |
Win NT does not allow more than 64.
|
static |
|
static |
|
static |
|
static |
Types for file create.
|
static |
|
static |
|
staticconstexpr |
|
static |
|
static |
|
static |
wait for OS aio resources to become available again
|
static |
|
staticconstexpr |
|
static |
|
static |
|
static |
|
static |
|
constexpr |
The next value should be smaller or equal to the smallest sector size used on any disk.
A log block is required to be a portion of disk which is written so that if the start and the end of a block get written to disk, then the whole block gets written. This should be true even in most cases of a crash: if this fails for a log block, then it is equivalent to a media failure in the log.
|
constexpr |
|
static |
|
static |
Error codes from os_file_get_and_log_last_error.
|
static |
|
static |
|
static |
Used by MySQLBackup.
|
static |
|
static |
|
static |
|
static |
|
extern |
|
constexpr |
A magic constant for the umask parameter that indicates caller wants the os_innodb_umask value to be used.
The os_innodb_umask is a static value, private to this module, and to the file creation methods, so it should not be used directly.
|
static |
|
static |
|
extern |
|
extern |
|
extern |
|
extern |
Number of pending read operations.
|
extern |
Number of pending write operations.
|
extern |