MySQL 9.1.0
Source Code Documentation
os0file.ic File Reference

The interface to the operating system file io. More...

#include "univ.i"

Functions

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)
 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)
 
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_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, ut::Location src_location)
 
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() which requests a synchronous read operation. 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)
 
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. 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. 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...
 

Detailed Description

The interface to the operating system file io.

Created 2/20/2010 Jimmy Yang

Function Documentation

◆ pfs_os_aio_func()

static dberr_t pfs_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,
ut::Location  src_location 
)
inlinestatic

◆ pfs_os_file_close_func()

static bool pfs_os_file_close_func ( pfs_os_file_t  file,
ut::Location  src_location 
)
inlinestatic

NOTE! Please use the corresponding macro os_file_close(), not directly this function! A performance schema instrumented wrapper function for os_file_close().

Parameters
[in]filehandle to a file
[in]src_locationlocation where func invoked
Returns
true if success

◆ pfs_os_file_copy_func()

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 
)
inlinestatic

Copy data from one file to another file.

Data is read/written at current file offset.

Parameters
[in]srcfile handle to copy from
[in]src_offsetoffset to copy from
[in]destfile handle to copy to
[in]dest_offsetoffset to copy to
[in]sizenumber of bytes to copy
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if successful

◆ pfs_os_file_create_func()

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 
)
inlinestatic

◆ pfs_os_file_create_simple_no_error_handling_func()

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 
)
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.

Parameters
[in]keyPerformance Schema Key
[in]namename of the file or path as a null-terminated string
[in]create_modecreate mode
[in]access_typeOS_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_onlyif true read only mode checks are enforced
[in]umaskUNIX access permission to be set when creating a file. Use os_umask_default to use global default umask.
[out]successtrue if succeeded
[in]src_locationlocation where func invoked
Returns
own: handle to the file, not defined if error, error number can be retrieved with os_file_get_last_error

◆ pfs_os_file_delete_func()

static bool pfs_os_file_delete_func ( mysql_pfs_key_t  key,
const char *  name,
ut::Location  src_location 
)
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()

Parameters
[in]keyPerformance Schema Key
[in]nameold file path as a null-terminated string
[in]src_locationlocation where func invoked
Returns
true if success

◆ pfs_os_file_delete_if_exists_func()

static bool pfs_os_file_delete_if_exists_func ( mysql_pfs_key_t  key,
const char *  name,
bool *  exist,
ut::Location  src_location 
)
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()

Parameters
[in]keyPerformance Schema Key
[in]nameold file path as a null-terminated string
[in]existindicate if file pre-exist
[in]src_locationlocation where func invoked
Returns
true if success

◆ pfs_os_file_flush_func()

static bool pfs_os_file_flush_func ( pfs_os_file_t  file,
ut::Location  src_location 
)
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.

Parameters
[in]fileOpen file handle
[in]src_locationlocation where func invoked
Returns
true if success

◆ pfs_os_file_read_first_page_func()

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 
)
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() which requests a synchronous read operation.

Parameters
[in,out]typeIO request context
[in]file_namefile name
[in]fileOpen file handle
[out]bufbuffer where to read
[in]nnumber of bytes to read
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if request was successful

◆ pfs_os_file_read_func()

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 
)
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.

Parameters
[in,out]typeIO request context
[in]file_namefile name
[in]fileOpen file handle
[out]bufbuffer where to read
[in]offsetfile offset where to read
[in]nnumber of bytes to read
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if request was successful

◆ pfs_os_file_read_no_error_handling_func()

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 
)
inlinestatic

◆ pfs_os_file_read_no_error_handling_int_fd_func()

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 
)
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.

Parameters
[in,out]typeIO request context
[in]file_namefile name
[in]fileOpen file handle
[out]bufbuffer where to read
[in]offsetfile offset where to read
[in]nnumber of bytes to read
[out]onumber of bytes actually read
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if request was successful

◆ pfs_os_file_rename_func()

static bool pfs_os_file_rename_func ( mysql_pfs_key_t  key,
const char *  oldpath,
const char *  newpath,
ut::Location  src_location 
)
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()

Parameters
[in]keyPerformance Schema Key
[in]oldpathold file path as a null-terminated string
[in]newpathnew file path
[in]src_locationlocation where func invoked
Returns
true if success

◆ pfs_os_file_write_func()

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 
)
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.

Parameters
[in,out]typeIO request context
[in]nameName of the file or path as NUL terminated string
[in]fileOpen file handle
[out]bufbuffer where to read
[in]offsetfile offset where to read
[in]nnumber of bytes to read
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if request was successful

◆ pfs_os_file_write_int_fd_func()

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 
)
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.

Parameters
[in,out]typeIO request context
[in]nameName of the file or path as NUL terminated string
[in]fileOpen file handle
[out]bufbuffer where to read
[in]offsetfile offset where to read
[in]nnumber of bytes to read
[in]src_locationlocation where func invoked
Returns
DB_SUCCESS if request was successful