/** Buffer page (uncompressed or compressed)*/typedefstructbuf_page_struct buf_page_t;structbuf_page_struct{/** @name General fields None of these bit-fields must be modified without holding Buf_page_get_mutex () [Buf_block _struct::mutex or Buf_pool->zip_mutex], since they can be stored on the same machine word. Some of these fields is additionally protected by Buf_pool->mutex. */ /* @{ */unsigned space: +;/*!< tablespace ID; also protected by Buf_pool->mutex.*/unsigned offset: +;/*!< page number; also protected by Buf_pool->mutex.*/unsigned state:buf_page_state_bits; /*!< State of the control block, also protected by Buf_pool->mutex. State transitions from buf_block_ready_for_use to buf_block_memory need not being protected by Buf_page_get_mutex (). @see enum Buf_page_state*/#ifndef univ_hotbackup unsigned flush_type:2;/*!< If this block was currently being flushed to disk, this tells the Flush_typ E. @see enum Buf_flush*/unsigned io_fix:2;/*!< type of pending I/O operation; Also protected by Buf_pool->mutex @see enum Buf_io_fix*/unsigned buf_fix_count: +;/*!< Count of how manyfold this block is currently bufferfixed*/unsigned buf_pool_index:6;/*!< Index number of the buffer pool that this block belongs to*/# ifMax_buffer_pools > -# Error"max_buffer_pools > Redefine buf_pool_index:6"# endif/* @} */#endif/* ! Univ_hotbackup * *page_zip_des_t zip; /*!< compressed page; Zip.data (but not the data it points to) is also protecte D by buf_pool->mutex; state = = Buf_block_zip_page and Zip.data = = NULL means an active Buf_pool->watch */#ifndef univ_hotbackup buf_page_t* HASH;/*!< node used in chaining to Buf_pool->page_hash or Buf_pool->zip_hash /c1>*/#ifdef univ_debug Ibool In_page_hash; /*!< TRUE if in Buf_pool->page_hash*/Ibool In_zip_hash; /*!< TRUE if in Buf_pool->zip_hash*/#endif/* Univ_debug *//** @name Page flushing fields All these is protected by Buf_pool->mutex.*/ /* @{ */ut_list_node_t (buf_page_t) LIST; /*!< based on state, this is a list node, protected either by Buf_pool->mutex or By Buf_pool->flush_list_mutex, in one of the following lists in Buf_pool:-Buf_block_not_used:free-buf_block_file_page:flush_list -Buf_block_zip_dirty:flush_list-buf_block_zip_page:zip_clean -buf_block_zip_free:zip_free[] If bpage is part of flush_list then the node Pointers is covered by Buf_pool->flush_list_mutex. Otherwise These pointers is protected by Buf_pool->mutex. The contents of the list node is undefined if!in_flush_list && state = = BUF _block_file_page, or if state is one of Buf_block_memory, Buf_block_remove_hash or Buf_block_ready_in_use. */#ifdef univ_debug Ibool in_flush_list; /*!< TRUE If in buf_pool->flush_list; When Buf_pool->flush_list_mutex are free, the following should hold:in_flush_list = = (state = = Buf_block_file_page | | state = = buf_block_zip_dirty) Writes to this field must is covered by both Block->mutex and buf_pool-> Flush_list_mutex. Hence reads can happen while holding any one of the-the-mutexes*/Ibool in_free_list; /*!< TRUE If in buf_pool->free; when Buf_pool->mutex are free, the following should hold:in_free_list = = (state = = buf_block_not_used)*/#endif/* Univ_debug */ib_uint64_t newest_modification; /*!< Log sequence number of the youngest modification to this block, zero if no T modified. Protected by block Mutex*/ib_uint64_t oldest_modification; /*!< Log sequence number of the START of the log entry written of the oldest Modification to this block which have not yet been flushed on disk; Zero if all modifications is on disk. Writes to this field must is covered by both Block->mutex and Buf_pool->flush_ List_mutex. Hence reads can happen while holding any one of the-the-mutexes*/ /* @} */ /** @name LRU Replacement algorithm fields These fields is protected by Buf_pool->mutex only (not Buf_pool-> ; Zip_mutex or Buf_block_struct::mutex). */ /* @{ */ut_list_node_t (buf_page_t) LRU; /*!< node of the LRU list*/#ifdef univ_debug Ibool in_lru_list; /*!< TRUE If the page is in the LRU list; used in debugging*/#endif/* Univ_debug */unsigned old:1;/*!< TRUE If the block is in the old blocks in Buf_pool->lru_old*/unsigned freed_page_clock: to;/*!< the value of Buf_pool->freed_page_clock when this block is the last Time put to the head of the LRU list; A thread is allowed to read this for heuristic purposes without holding any Mutex or latch*/ /* @} */unsigned access_time; /*!< time of first access, or 0 if the block is never accessed in the buffer p Ool. Protected by block Mutex*/# ifDefined Univ_debug_file_accesses | |defined univ_debug Ibool file_page_was_freed; /*!< This was set to TRUE if FSP frees a page in buffer pool*/# endif/*Univ_debug_file_accesses | | Univ_debug*/#endif/* ! Univ_hotbackup * *};
Structural Body buf_page_t