4473
4473
return(DB_SUCCESS);
4476
/********************************************************************//**
4477
Confirm whether the parameters are valid or not */
4482
ulint space_id, /*!< in: space id */
4483
ulint block_offset) /*!< in: offset in number of blocks */
4488
/* Reserve the fil_system mutex and make sure that we can open at
4489
least one file while holding it, if the file is not already open */
4491
fil_mutex_enter_and_prepare_for_io(space_id);
4493
space = fil_space_get_by_id(space_id);
4496
mutex_exit(&fil_system->mutex);
4500
node = UT_LIST_GET_FIRST(space->chain);
4503
if (UNIV_UNLIKELY(node == NULL)) {
4504
mutex_exit(&fil_system->mutex);
4508
if (space->id != 0 && node->size == 0) {
4509
/* We do not know the size of a single-table tablespace
4510
before we open the file */
4515
if (node->size > block_offset) {
4519
block_offset -= node->size;
4520
node = UT_LIST_GET_NEXT(chain, node);
4524
/* Open file if closed */
4525
fil_node_prepare_for_io(node, fil_system, space);
4526
fil_node_complete_io(node, fil_system, OS_FILE_READ);
4528
/* Check that at least the start offset is within the bounds of a
4529
single-table tablespace */
4530
if (UNIV_UNLIKELY(node->size <= block_offset)
4531
&& space->id != 0 && space->purpose == FIL_TABLESPACE) {
4532
mutex_exit(&fil_system->mutex);
4536
mutex_exit(&fil_system->mutex);
4476
4540
#ifndef UNIV_HOTBACKUP
4477
4541
/**********************************************************************//**
4478
4542
Waits for an aio operation to complete. This function is used to write the