MySQL 8.0.39
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 |
The IO Context that is passed down to the low level IO code. 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... | |
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... | |
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 | 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, type, read_only, success) |
#define | os_file_create_simple_no_error_handling(key, name, create_mode, access, read_only, success) |
#define | os_file_create_simple_no_error_handling_with_umask( key, name, create_mode, access, read_only, 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, read_only, message1, message2) |
#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) |
#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) os_file_read_first_page_pfs(type, file_name, file, buf, n) |
#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) |
#define | IORequestRead IORequest(IORequest::READ) |
Types for AIO operations. More... | |
#define | IORequestWrite IORequest(IORequest::WRITE) |
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 , SYNC = 24 } |
Modes for aio operations. More... | |
Functions | |
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, bool read_only, mode_t umask, bool *success) |
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. More... | |
void | os_file_set_nocache (int fd, const char *file_name, const char *operation_name) |
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, ulint type, 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, bool read_only, mode_t umask, bool *success, ut::Location src_location) |
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(). More... | |
static pfs_os_file_t | pfs_os_file_create_func (mysql_pfs_key_t key, const char *name, ulint create_mode, ulint purpose, ulint type, 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 (IORequest &type, const char *file_name, pfs_os_file_t file, void *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, void *buf, ulint n, 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 of page 0 of IBD file. 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, void *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, void *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, void *buf, os_offset_t offset, ulint n, bool read_only, fil_node_t *m1, void *m2, 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 void *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 void *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... | |
bool | os_file_set_size_fast (const char *name, pfs_os_file_t file, os_offset_t offset, os_offset_t size, bool flush) |
Allocate a block to file using fallocate from the given offset if fallocate is supported. More... | |
bool | os_file_set_size (const char *name, pfs_os_file_t file, os_offset_t offset, os_offset_t size, bool flush) |
Write the specified number of zeros to a file from specific 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_last_error (bool report_all_errors) |
Retrieves the last error number if an error occurs in a file io function. More... | |
dberr_t | os_file_read_func (IORequest &type, const char *file_name, os_file_t file, void *buf, os_offset_t offset, ulint n) |
NOTE! Use the corresponding macro os_file_read_first_page(), 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, void *buf, ulint n) |
NOTE! Use the corresponding macro os_file_read_first_page(), not directly this function! Requests a synchronous read operation of page 0 of IBD file. 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, void *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 void *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_status (const char *path, bool *exists, os_file_type_t *type) |
Check the existence and type of a given path. More... | |
bool | os_file_exists (const char *path) |
Check the existence and usefulness of a given path. 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, void *buf, os_offset_t offset, ulint n, bool read_only, fil_node_t *m1, void *m2) |
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, fil_node_t **m1, void **m2, 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... | |
dberr_t | os_file_get_status (const char *path, os_file_stat_t *stat_info, bool check_rw_perm, bool read_only) |
This function returns information about the specified file. More... | |
bool | os_file_check_mode (const char *name, 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... | |
ulint | os_file_original_page_size (const byte *buf) |
If it is a compressed page return the original 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... | |
bool | os_is_sparse_file_supported (pfs_os_file_t fh) |
Check if the file system supports sparse files. 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... | |
dberr_t | os_file_write_zeros (pfs_os_file_t file, const char *name, ulint page_size, os_offset_t start, ulint len) |
Fill the pages with NULs. 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, void *&buf, ulint n) |
Encrypt a page content when write it to disk. More... | |
file::Block * | os_file_compress_page (IORequest &type, void *&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 void *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 IORequestRead IORequest(IORequest::READ) |
Types for AIO operations.
No transformations during read/write, write as is.
#define IORequestWrite IORequest(IORequest::WRITE) |
#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 | ( | key, | |
name, | |||
create_mode, | |||
access, | |||
read_only, | |||
success | |||
) |
#define os_file_create_simple_no_error_handling_with_umask | ( | key, | |
name, | |||
create_mode, | |||
access, | |||
read_only, | |||
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 | |||
) | os_file_read_first_page_pfs(type, file_name, file, buf, n) |
#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 |
Modes for aio operations.
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 |
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, | ||
void * | buf, | ||
os_offset_t | offset, | ||
ulint | n, | ||
bool | read_only, | ||
fil_node_t * | m1, | ||
void * | m2 | ||
) |
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] | read_only | if true read only mode checks are enforced |
[in,out] | m1 | Message for the AIO handler, (can be used to identify a completed AIO operation); ignored if mode is OS_AIO_SYNC |
[in,out] | m2 | message for the AIO handler (can be used to identify a completed AIO operation); ignored if mode is OS_AIO_SYNC |
dberr_t os_aio_handler | ( | ulint | segment, |
fil_node_t ** | m1, | ||
void ** | m2, | ||
IORequest * | request | ||
) |
Waits for an AIO operation to complete.
This function is used to wait the for completed requests. 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] | m1 | the messages passed with the AIO request; note that also in the case where the AIO operation failed, these output parameters are valid and can be used to restart the operation, for example |
[out] | m2 | callback message |
[out] | request | OS_FILE_WRITE or ..._READ |
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 BUFFER_BLOCK_SIZE 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.
bool os_file_check_mode | ( | const char * | name, |
bool | read_only | ||
) |
Check if a file can be opened in read-write mode.
[in] | name | filename to check |
[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_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, |
void *& | 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, | ||
ulint | type, | ||
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_FILE_AIO, if asynchronous, non-buffered I/O is desired, OS_FILE_NORMAL, if any normal file; NOTE that it also depends on type, os_aio_.. and srv_.. variables whether we really use async I/O or unbuffered I/O: look in the function source code for the exact rules |
[in] | type | OS_DATA_FILE, OS_LOG_FILE etc. |
[in] | read_only | if true read only mode checks are enforced |
[in] | 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, | ||
bool | read_only, | ||
mode_t | umask, | ||
bool * | success | ||
) |
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] | read_only | if true read only mode checks are enforced |
[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, |
void *& | 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 exists and can be used |
false | if the path does not exist or if the path is unusable to get to a possibly existing file or directory. |
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_last_error | ( | bool | report_all_errors | ) |
Retrieves the last error number if an 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.
[in] | report_all_errors | true if we want an error message printed for all errors |
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, | ||
bool | check_rw_perm, | ||
bool | read_only | ||
) |
This function returns information about the specified file.
[in] | path | pathname of the file |
[out] | stat_info | information of a file in a directory |
[in] | check_rw_perm | for testing whether the file can be opened in RW mode |
[in] | read_only | true if file is opened in read-only mode |
If it is a compressed page return the original page data + footer size.
[in] | buf | Buffer to check, must include header + 10 bytes |
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, | ||
void * | buf, | ||
ulint | n | ||
) |
NOTE! Use the corresponding macro os_file_read_first_page(), 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] | n | number of bytes to read |
dberr_t os_file_read_func | ( | IORequest & | type, |
const char * | file_name, | ||
os_file_t | file, | ||
void * | buf, | ||
os_offset_t | offset, | ||
ulint | n | ||
) |
NOTE! Use the corresponding macro os_file_read_first_page(), 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, | ||
void * | 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 | ||
) |
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 |
bool os_file_set_size | ( | const char * | name, |
pfs_os_file_t | file, | ||
os_offset_t | offset, | ||
os_offset_t | size, | ||
bool | flush | ||
) |
Write the specified number of zeros to a file from specific offset.
[in] | name | name of the file or path as a null-terminated string |
[in] | file | handle to a file |
[in] | offset | file offset |
[in] | size | file size |
[in] | flush | flush file content to disk |
bool os_file_set_size_fast | ( | const char * | name, |
pfs_os_file_t | file, | ||
os_offset_t | offset, | ||
os_offset_t | size, | ||
bool | flush | ||
) |
Allocate a block to file using fallocate from the given offset if fallocate is supported.
Falls back to the old slower method of writing zeros otherwise.
[in] | name | name of the file |
[in] | file | handle to the file |
[in] | offset | file offset |
[in] | size | file size |
[in] | flush | flush file content to disk |
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 | ( | const char * | path, |
bool * | exists, | ||
os_file_type_t * | type | ||
) |
Check the existence and type of a given path.
[in] | path | pathname of the file |
[out] | exists | true if file exists |
[out] | type | type of the file (if it exists) |
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 |
dberr_t os_file_write_func | ( | IORequest & | type, |
const char * | name, | ||
os_file_t | file, | ||
const void * | 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 void * | 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 |
dberr_t os_file_write_zeros | ( | pfs_os_file_t | file, |
const char * | name, | ||
ulint | page_size, | ||
os_offset_t | start, | ||
ulint | len | ||
) |
Fill the pages with NULs.
[in] | file | File handle |
[in] | name | File name |
[in] | page_size | physical page size |
[in] | start | Offset from the start of the file in bytes |
[in] | len | Length in bytes |
|
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. |
bool os_is_sparse_file_supported | ( | pfs_os_file_t | fh | ) |
Check if the file system supports sparse files.
Warning: On POSIX systems we try and punch a hole from offset 0 to the system configured page size. This should only be called on an empty file.
Note: On Windows we use the name and on Unices we use the file handle.
[in] | fh | File handle for the file - if opened |
|
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] | read_only | if true read only mode checks are enforced |
[in,out] | m1 | Message for the AIO handler, (can be used to identify a completed AIO operation); ignored if mode is OS_AIO_SYNC |
[in,out] | m2 | message for the AIO handler (can be used to identify a completed AIO operation); ignored if mode is OS_AIO_SYNC |
[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_FILE_AIO, if asynchronous, non-buffered I/O is desired, OS_FILE_NORMAL, if any normal file; NOTE that it also depends on type, os_aio_.. and srv_.. variables whether we really use async I/O or unbuffered I/O: look in the function source code for the exact rules |
[in] | type | OS_DATA_FILE or OS_LOG_FILE |
[in] | read_only | if true read only mode checks are enforced |
[out] | success | true if succeeded |
[in] | src_location | location where func invoked |
|
inlinestatic |
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] | read_only | if true read only mode checks are enforced |
[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 of page 0 of IBD file.
[in,out] | type | IO request context |
[in] | file_name | file name |
[in] | file | Open file handle |
[out] | buf | buffer 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(), 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 |
|
extern |
|
static |
Win NT does not allow more than 64.
|
static |
|
static |
|
static |
|
static |
Types for file create.
|
static |
Doublewrite files.
|
staticconstexpr |
|
static |
|
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 |
|
static |
Error codes from os_file_get_last_error.
|
static |
|
static |
|
static |
Used by MySQLBackup.
|
static |
|
static |
|
static |
|
static |
|
extern |
|
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 |
|
extern |
|
extern |
|
extern |
|
extern |
Number of pending read operations.
|
extern |
Number of pending write operations.
|
static |
Redo log archive file.