Commit 68b5aeae authored by Marko Mäkelä's avatar Marko Mäkelä

Minor cleanup of InnoDB I/O routines

Change many function parameters from IORequest& to const IORequest&.

Remove an unused definition of ECANCELED.
parent 859714e7
......@@ -979,7 +979,7 @@ pfs_os_file_close_func(
this function!
This is the performance schema instrumented wrapper function for
os_file_read() which requests a synchronous read operation.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] file Open file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -990,7 +990,7 @@ os_file_read() which requests a synchronous read operation.
UNIV_INLINE
dberr_t
pfs_os_file_read_func(
IORequest& type,
const IORequest& type,
pfs_os_file_t file,
void* buf,
os_offset_t offset,
......@@ -1003,7 +1003,7 @@ 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.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] file Open file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -1015,7 +1015,7 @@ read operation.
UNIV_INLINE
dberr_t
pfs_os_file_read_no_error_handling_func(
IORequest& type,
const IORequest& type,
pfs_os_file_t file,
void* buf,
os_offset_t offset,
......@@ -1028,7 +1028,7 @@ pfs_os_file_read_no_error_handling_func(
function!
Performance schema wrapper function of os_aio() which requests
an asynchronous I/O operation.
@param[in] type IO request context
@param[in,out] type IO request context
@param[in] mode IO mode
@param[in] name Name of the file or path as NUL terminated
string
......@@ -1066,7 +1066,7 @@ pfs_os_aio_func(
this function!
This is the performance schema instrumented wrapper function for
os_file_write() which requests a synchronous write operation.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] name Name of the file or path as NUL terminated
string
@param[in] file Open file handle
......@@ -1079,7 +1079,7 @@ os_file_write() which requests a synchronous write operation.
UNIV_INLINE
dberr_t
pfs_os_file_write_func(
IORequest& type,
const IORequest& type,
const char* name,
pfs_os_file_t file,
const void* buf,
......@@ -1293,7 +1293,7 @@ Requests a synchronous read operation.
@return DB_SUCCESS if request was successful */
dberr_t
os_file_read_func(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
......@@ -1325,7 +1325,7 @@ any error handling. In case of error it returns FALSE.
@return DB_SUCCESS or error code */
dberr_t
os_file_read_no_error_handling_func(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
......@@ -1336,7 +1336,7 @@ os_file_read_no_error_handling_func(
/** NOTE! Use the corresponding macro os_file_write(), not directly this
function!
Requests a synchronous write operation.
@param[in,out] type IO request context
@param[in] type IO request context
@param[in] file Open file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -1344,7 +1344,7 @@ Requests a synchronous write operation.
@return DB_SUCCESS if request was successful */
dberr_t
os_file_write_func(
IORequest& type,
const IORequest& type,
const char* name,
os_file_t file,
const void* buf,
......@@ -1432,7 +1432,7 @@ os_aio_free();
/**
NOTE! Use the corresponding macro os_aio(), not directly this function!
Requests an asynchronous i/o operation.
@param[in] type IO request context
@param[in,out] type IO request context
@param[in] mode IO mode
@param[in] name Name of the file or path as NUL terminated
string
......
......@@ -207,7 +207,7 @@ pfs_os_file_close_func(
function!
Performance schema wrapper function of os_aio() which requests
an asynchronous i/o operation.
@param[in] type IO request context
@param[in,type] type IO request context
@param[in] mode IO mode
@param[in] name Name of the file or path as NUL terminated
string
......@@ -264,7 +264,7 @@ pfs_os_aio_func(
this function!
This is the performance schema instrumented wrapper function for
os_file_read() which requests a synchronous read operation.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] file Open file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -275,7 +275,7 @@ os_file_read() which requests a synchronous read operation.
UNIV_INLINE
dberr_t
pfs_os_file_read_func(
IORequest& type,
const IORequest& type,
pfs_os_file_t file,
void* buf,
os_offset_t offset,
......@@ -305,7 +305,7 @@ 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.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] file Open file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -317,7 +317,7 @@ read operation.
UNIV_INLINE
dberr_t
pfs_os_file_read_no_error_handling_func(
IORequest& type,
const IORequest& type,
pfs_os_file_t file,
void* buf,
os_offset_t offset,
......@@ -343,7 +343,7 @@ pfs_os_file_read_no_error_handling_func(
/** NOTE! Please use the corresponding macro
os_file_read_no_error_handling_int_fd() to request
a synchronous read operation.
@param[in,out] type read request
@param[in] type read request
@param[in] file file handle
@param[out] buf buffer where to read
@param[in] offset file offset where to read
......@@ -354,7 +354,7 @@ a synchronous read operation.
UNIV_INLINE
bool
pfs_os_file_read_no_error_handling_int_fd_func(
IORequest& type,
const IORequest& type,
int file,
void* buf,
os_offset_t offset,
......@@ -387,7 +387,7 @@ pfs_os_file_read_no_error_handling_int_fd_func(
this function!
This is the performance schema instrumented wrapper function for
os_file_write() which requests a synchronous write operation.
@param[in, out] type IO request context
@param[in] type IO request context
@param[in] name Name of the file or path as NUL terminated
string
@param[in] file Open file handle
......@@ -401,7 +401,7 @@ os_file_write() which requests a synchronous write operation.
UNIV_INLINE
dberr_t
pfs_os_file_write_func(
IORequest& type,
const IORequest& type,
const char* name,
pfs_os_file_t file,
const void* buf,
......@@ -429,7 +429,7 @@ pfs_os_file_write_func(
not directly this function!
This is the performance schema instrumented wrapper function for
os_file_write_int_fd() which requests a synchronous write operation.
@param[in,out] type write request
@param[in] type write request
@param[in] name file name
@param[in] file file handle
@param[in] buf buffer to write
......@@ -441,7 +441,7 @@ os_file_write_int_fd() which requests a synchronous write operation.
UNIV_INLINE
bool
pfs_os_file_write_int_fd_func(
IORequest& type,
const IORequest& type,
const char* name,
int file,
const void* buf,
......
......@@ -107,9 +107,6 @@ static ulint os_innodb_umask = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP;
#else
/** Umask for creating files */
static ulint os_innodb_umask = 0;
#ifndef ECANCELED
#define ECANCELED 125
#endif
static HANDLE completion_port;
static HANDLE read_completion_port;
static DWORD fls_sync_io = FLS_OUT_OF_INDEXES;
......@@ -303,7 +300,7 @@ class AIO {
/** Requests for a slot in the aio array. If no slot is available, waits
until not_full-event becomes signaled.
@param[in,out] type IO context
@param[in] type IO context
@param[in,out] m1 message to be passed along with the AIO
operation
@param[in,out] m2 message to be passed along with the AIO
......@@ -316,7 +313,7 @@ class AIO {
@param[in] len length of the block to read or write
@return pointer to slot */
Slot* reserve_slot(
IORequest& type,
const IORequest& type,
fil_node_t* m1,
void* m2,
pfs_os_file_t file,
......@@ -510,7 +507,7 @@ class AIO {
MY_ATTRIBUTE((warn_unused_result));
/** Select the IO slot array
@param[in] type Type of IO, READ or WRITE
@param[in,out] type Type of IO, READ or WRITE
@param[in] read_only true if running in read-only mode
@param[in] mode IO mode
@return slot array or NULL if invalid mode specified */
......@@ -4931,7 +4928,7 @@ os_file_io(
static MY_ATTRIBUTE((warn_unused_result))
ssize_t
os_file_pwrite(
IORequest& type,
const IORequest& type,
os_file_t file,
const byte* buf,
ulint n,
......@@ -4939,6 +4936,7 @@ os_file_pwrite(
dberr_t* err)
{
ut_ad(type.validate());
ut_ad(type.is_write());
++os_n_file_writes;
......@@ -4951,17 +4949,17 @@ os_file_pwrite(
return(n_bytes);
}
/** Requests a synchronous write operation.
/** NOTE! Use the corresponding macro os_file_write(), not directly
Requests a synchronous write operation.
@param[in] type IO flags
@param[in] file handle to an open file
@param[out] buf buffer from which to write
@param[in] offset file offset from the start where to read
@param[in] n number of bytes to read, starting from offset
@return DB_SUCCESS if request was successful, false if fail */
static MY_ATTRIBUTE((warn_unused_result))
dberr_t
os_file_write_page(
IORequest& type,
os_file_write_func(
const IORequest& type,
const char* name,
os_file_t file,
const void* buf,
......@@ -4970,7 +4968,6 @@ os_file_write_page(
{
dberr_t err;
ut_ad(type.is_write());
ut_ad(type.validate());
ut_ad(n > 0);
......@@ -5017,13 +5014,15 @@ os_file_write_page(
static MY_ATTRIBUTE((warn_unused_result))
ssize_t
os_file_pread(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
ulint n,
os_offset_t offset,
dberr_t* err)
{
ut_ad(type.is_read());
++os_n_file_reads;
const bool monitor = MONITOR_IS_ON(MONITOR_OS_PENDING_READS);
......@@ -5047,7 +5046,7 @@ os_file_pread(
static MY_ATTRIBUTE((warn_unused_result))
dberr_t
os_file_read_page(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
......@@ -5421,14 +5420,12 @@ Requests a synchronous positioned read operation.
@return DB_SUCCESS or error code */
dberr_t
os_file_read_func(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
ulint n)
{
ut_ad(type.is_read());
return(os_file_read_page(type, file, buf, offset, n, NULL, true));
}
......@@ -5445,43 +5442,16 @@ Requests a synchronous positioned read operation.
@return DB_SUCCESS or error code */
dberr_t
os_file_read_no_error_handling_func(
IORequest& type,
const IORequest& type,
os_file_t file,
void* buf,
os_offset_t offset,
ulint n,
ulint* o)
{
ut_ad(type.is_read());
return(os_file_read_page(type, file, buf, offset, n, o, false));
}
/** NOTE! Use the corresponding macro os_file_write(), not directly
Requests a synchronous write operation.
@param[in] type IO flags
@param[in] file handle to an open file
@param[out] buf buffer from which to write
@param[in] offset file offset from the start where to read
@param[in] n number of bytes to read, starting from offset
@return DB_SUCCESS if request was successful, false if fail */
dberr_t
os_file_write_func(
IORequest& type,
const char* name,
os_file_t file,
const void* buf,
os_offset_t offset,
ulint n)
{
ut_ad(type.validate());
ut_ad(type.is_write());
const byte* ptr = reinterpret_cast<const byte*>(buf);
return(os_file_write_page(type, name, file, ptr, offset, n));
}
/** Check the existence and type of the given file.
@param[in] path path name of file
@param[out] exists true if the file exists
......@@ -6146,7 +6116,7 @@ AIO::get_segment_no_from_slot(
/** Requests for a slot in the aio array. If no slot is available, waits until
not_full-event becomes signaled.
@param[in,out] type IO context
@param[in] type IO context
@param[in,out] m1 message to be passed along with the AIO
operation
@param[in,out] m2 message to be passed along with the AIO
......@@ -6160,7 +6130,7 @@ not_full-event becomes signaled.
@return pointer to slot */
Slot*
AIO::reserve_slot(
IORequest& type,
const IORequest& type,
fil_node_t* m1,
void* m2,
pfs_os_file_t file,
......@@ -6378,7 +6348,7 @@ os_aio_simulated_wake_handler_threads()
}
/** Select the IO slot array
@param[in] type Type of IO, READ or WRITE
@param[in,out] type Type of IO, READ or WRITE
@param[in] read_only true if running in read-only mode
@param[in] mode IO mode
@return slot array or NULL if invalid mode specified */
......@@ -6595,7 +6565,7 @@ os_aio_windows_handler(
/**
NOTE! Use the corresponding macro os_aio(), not directly this function!
Requests an asynchronous i/o operation.
@param[in] type IO request context
@param[in,out] type IO request context
@param[in] mode IO mode
@param[in] name Name of the file or path as NUL terminated
string
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment