299
298
/** The tablespace memory cache. This variable is NULL before the module is
301
fil_system_t* fil_system = NULL;
300
static fil_system_t* fil_system = NULL;
304
303
/********************************************************************//**
684
683
os_file_get_size(node->handle, &size_low, &size_high);
686
size_bytes = (((uint64_t)size_high) << 32) + size_low;
685
size_bytes = (((ib_int64_t)size_high) << 32)
686
+ (ib_int64_t)size_low;
687
687
#ifdef UNIV_HOTBACKUP
688
688
if (space->id == 0) {
689
node->size = size_bytes / UNIV_PAGE_SIZE;
689
node->size = (ulint) (size_bytes / UNIV_PAGE_SIZE);
690
690
os_file_close(node->handle);
3448
3448
idea is to read as much good data as we can and jump over bad data.
3449
3449
@return 0 if ok, -1 if error even after the retries, 1 if at the end
3450
3450
of the directory */
3452
3453
fil_file_readdir_next_file(
3453
3454
/*=======================*/
4469
4473
return(DB_SUCCESS);
4472
/********************************************************************//**
4473
Confirm whether the parameters are valid or not */
4478
ulint space_id, /*!< in: space id */
4479
ulint block_offset) /*!< in: offset in number of blocks */
4484
/* Reserve the fil_system mutex and make sure that we can open at
4485
least one file while holding it, if the file is not already open */
4487
fil_mutex_enter_and_prepare_for_io(space_id);
4489
space = fil_space_get_by_id(space_id);
4492
mutex_exit(&fil_system->mutex);
4496
node = UT_LIST_GET_FIRST(space->chain);
4499
if (UNIV_UNLIKELY(node == NULL)) {
4500
mutex_exit(&fil_system->mutex);
4504
if (space->id != 0 && node->size == 0) {
4505
/* We do not know the size of a single-table tablespace
4506
before we open the file */
4511
if (node->size > block_offset) {
4515
block_offset -= node->size;
4516
node = UT_LIST_GET_NEXT(chain, node);
4520
/* Open file if closed */
4521
fil_node_prepare_for_io(node, fil_system, space);
4522
fil_node_complete_io(node, fil_system, OS_FILE_READ);
4524
/* Check that at least the start offset is within the bounds of a
4525
single-table tablespace */
4526
if (UNIV_UNLIKELY(node->size <= block_offset)
4527
&& space->id != 0 && space->purpose == FIL_TABLESPACE) {
4528
mutex_exit(&fil_system->mutex);
4532
mutex_exit(&fil_system->mutex);
4536
4476
#ifndef UNIV_HOTBACKUP
4537
4477
/**********************************************************************//**
4538
4478
Waits for an aio operation to complete. This function is used to write the