MySQL 8.0.31
Source Code Documentation
fsp0fsp.ic File Reference

File space management. More...

Functions

static bool fsp_descr_page (const page_id_t &page_id, const page_size_t &page_size)
 Checks if a page address is an extent descriptor page address. More...
 
static bool fsp_flags_is_compressed (uint32_t flags)
 Determine if the tablespace is compressed from tablespace flags. More...
 
constexpr uint32_t ACTUAL_SSIZE (uint32_t ssize)
 
static bool fsp_flags_are_equal (uint32_t flags1, uint32_t flags2)
 Determine if two tablespaces are equivalent or compatible. More...
 
static uint32_t page_size_to_ssize (ulint page_size)
 Convert a page size, which is a power of 2, to an ssize, which is the number of bit shifts from 512 to make that page size. More...
 
static uint32_t fsp_flags_set_zip_size (uint32_t flags, const page_size_t &page_size)
 Add the compressed page size to the tablespace flags. More...
 
static uint32_t fsp_flags_set_page_size (uint32_t flags, const page_size_t &page_size)
 Add the page size to the tablespace flags. More...
 
static uint32_t fsp_flags_init (const page_size_t &page_size, bool atomic_blobs, bool has_data_dir, bool is_shared, bool is_temporary, bool is_encrypted)
 Initialize an FSP flags integer. More...
 
static ulint xdes_calc_descriptor_index (const page_size_t &page_size, ulint offset)
 Calculates the descriptor index within a descriptor page. More...
 
static bool xdes_get_bit (const xdes_t *descr, ulint bit, page_no_t offset)
 Gets a descriptor bit of a page. More...
 
static page_no_t xdes_calc_descriptor_page (const page_size_t &page_size, page_no_t offset)
 Calculates the page where the descriptor of a page resides. More...
 
static ulint xdes_arr_size (const page_size_t &page_size)
 Calculates the descriptor array size. More...
 
bool fsp_is_inode_page (page_no_t page)
 Check if a specified page is inode page or not. More...
 
bool fsp_flags_is_valid (uint32_t flags)
 Validate the tablespace flags. More...
 
ulint fsp_header_get_sdi_offset (const page_size_t &page_size)
 Get the offset of SDI root page number in page 0. More...
 
ulint fsp_header_get_encryption_progress_offset (const page_size_t &page_size)
 Get the offset of encryption progress information in page 0. More...
 
static uint32_t fsp_header_get_server_version (const page_t *page)
 Reads the server space version from the first page of a tablespace. More...
 
static uint32_t fsp_header_get_space_version (const page_t *page)
 Reads the server space version from the first page of a tablespace. More...
 

Detailed Description

File space management.

Created 12/18/1995 Heikki Tuuri

Function Documentation

◆ ACTUAL_SSIZE()

constexpr uint32_t ACTUAL_SSIZE ( uint32_t  ssize)
constexpr

◆ fsp_descr_page()

static bool fsp_descr_page ( const page_id_t page_id,
const page_size_t page_size 
)
inlinestatic

Checks if a page address is an extent descriptor page address.

Parameters
[in]page_idpage id
[in]page_sizepage size
Returns
true if a descriptor page

◆ fsp_flags_are_equal()

static bool fsp_flags_are_equal ( uint32_t  flags1,
uint32_t  flags2 
)
inlinestatic

Determine if two tablespaces are equivalent or compatible.

Parameters
[in]flags1First tablespace flags
[in]flags2Second tablespace flags
Returns
true the flags are compatible, false if not

◆ fsp_flags_init()

static uint32_t fsp_flags_init ( const page_size_t page_size,
bool  atomic_blobs,
bool  has_data_dir,
bool  is_shared,
bool  is_temporary,
bool  is_encrypted 
)
inlinestatic

Initialize an FSP flags integer.

Parameters
[in]page_sizepage sizes in bytes and compression flag.
[in]atomic_blobsUsed by Dynammic and Compressed.
[in]has_data_dirThis tablespace is in a remote location.
[in]is_sharedThis tablespace can be shared by many tables.
[in]is_temporaryThis tablespace is temporary.
[in]is_encryptedThis tablespace is encrypted.
Returns
tablespace flags after initialization

◆ fsp_flags_is_compressed()

static bool fsp_flags_is_compressed ( uint32_t  flags)
inlinestatic

Determine if the tablespace is compressed from tablespace flags.

Parameters
[in]flagsTablespace flags
Returns
true if compressed, false if not compressed

◆ fsp_flags_is_valid()

bool fsp_flags_is_valid ( uint32_t  flags)
inline

Validate the tablespace flags.

These flags are stored in the tablespace header at offset FSP_SPACE_FLAGS. They should be 0 for ROW_FORMAT=COMPACT and ROW_FORMAT=REDUNDANT. The newer row formats, COMPRESSED and DYNAMIC, will have at least the DICT_TF_COMPACT bit set.

Parameters
[in]flagsTablespace flags
Returns
true if valid, false if not

◆ fsp_flags_set_page_size()

static uint32_t fsp_flags_set_page_size ( uint32_t  flags,
const page_size_t page_size 
)
inlinestatic

Add the page size to the tablespace flags.

Parameters
[in]flagsTablespace flags
[in]page_sizepage sizes in bytes and compression flag.
Returns
tablespace flags after page size is added

◆ fsp_flags_set_zip_size()

static uint32_t fsp_flags_set_zip_size ( uint32_t  flags,
const page_size_t page_size 
)
inlinestatic

Add the compressed page size to the tablespace flags.

Parameters
[in]flagsTablespace flags
[in]page_sizepage sizes in bytes and compression flag.
Returns
tablespace flags after zip size is added

◆ fsp_header_get_encryption_progress_offset()

ulint fsp_header_get_encryption_progress_offset ( const page_size_t page_size)
inline

Get the offset of encryption progress information in page 0.

Parameters
[in]page_sizepage size.
Returns
offset on success, otherwise 0.

◆ fsp_header_get_sdi_offset()

ulint fsp_header_get_sdi_offset ( const page_size_t page_size)
inline

Get the offset of SDI root page number in page 0.

Parameters
[in]page_sizePage size.
Returns
offset on success, else 0

◆ fsp_header_get_server_version()

static uint32_t fsp_header_get_server_version ( const page_t page)
inlinestatic

Reads the server space version from the first page of a tablespace.

Parameters
[in]pagefirst page of a tablespace
Returns
space server version

◆ fsp_header_get_space_version()

static uint32_t fsp_header_get_space_version ( const page_t page)
inlinestatic

Reads the server space version from the first page of a tablespace.

Parameters
[in]pagefirst page of a tablespace
Returns
space server version

◆ fsp_is_inode_page()

bool fsp_is_inode_page ( page_no_t  page)
inline

Check if a specified page is inode page or not.

This is used for index root pages of hard-coded DD tables, we can safely assume that the passed in page number is in the range of pages which are only either index root page or inode page

Parameters
[in]pagePage number to check
Returns
true if it's inode page, otherwise false

◆ page_size_to_ssize()

static uint32_t page_size_to_ssize ( ulint  page_size)
inlinestatic

Convert a page size, which is a power of 2, to an ssize, which is the number of bit shifts from 512 to make that page size.

Parameters
[in]page_sizecompressed page size in bytes
Returns
an ssize created from the page size provided.

◆ xdes_arr_size()

static ulint xdes_arr_size ( const page_size_t page_size)
inlinestatic

Calculates the descriptor array size.

Parameters
[in]page_sizepage size
Returns
size of descriptor array

◆ xdes_calc_descriptor_index()

static ulint xdes_calc_descriptor_index ( const page_size_t page_size,
ulint  offset 
)
inlinestatic

Calculates the descriptor index within a descriptor page.

Parameters
[in]page_sizepage size
[in]offsetpage offset
Returns
descriptor index

◆ xdes_calc_descriptor_page()

static page_no_t xdes_calc_descriptor_page ( const page_size_t page_size,
page_no_t  offset 
)
inlinestatic

Calculates the page where the descriptor of a page resides.

Parameters
[in]page_sizepage size
[in]offsetpage offset
Returns
descriptor page offset

◆ xdes_get_bit()

static bool xdes_get_bit ( const xdes_t descr,
ulint  bit,
page_no_t  offset 
)
inlinestatic

Gets a descriptor bit of a page.

Returns
true if free
Parameters
descrin: descriptor
bitin: XDES_FREE_BIT or XDES_CLEAN_BIT
offsetin: page offset within extent: 0 ... FSP_EXTENT_SIZE - 1