MySQL 8.3.0
Source Code Documentation
fut0lst.ic File Reference

File-based list utilities. More...

#include "buf0buf.h"
#include "fut0fut.h"
#include "mtr0log.h"

Functions

static void flst_write_addr (fil_faddr_t *faddr, fil_addr_t addr, mtr_t *mtr)
 Writes a file address. More...
 
static fil_addr_t flst_read_addr (const fil_faddr_t *faddr, mtr_t *mtr)
 Reads a file address. More...
 
static void flst_init (flst_base_node_t *base, mtr_t *mtr)
 Initializes a list base node. More...
 
static ulint flst_get_len (const flst_base_node_t *base)
 Get the length of a list. More...
 
static fil_addr_t flst_get_first (const flst_base_node_t *base, mtr_t *mtr)
 Gets list first node address. More...
 
static fil_addr_t flst_get_last (const flst_base_node_t *base, mtr_t *mtr)
 Gets list last node address. More...
 
static fil_addr_t flst_get_next_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list next node address. More...
 
static fil_addr_t flst_get_prev_addr (const flst_node_t *node, mtr_t *mtr)
 Gets list prev node address. More...
 

Variables

constexpr uint32_t FLST_PREV = 0
 6-byte address of the previous list element; the page part of address is FIL_NULL, if no previous element More...
 
constexpr uint32_t FLST_NEXT = FIL_ADDR_SIZE
 
constexpr uint32_t FLST_LEN = 0
 32-bit list length field More...
 
constexpr uint32_t FLST_FIRST = 4
 6-byte address of the first element of the list; undefined if empty list More...
 
constexpr uint32_t FLST_LAST = 4 + FIL_ADDR_SIZE
 6-byte address of the last element of the list; undefined if empty list More...
 

Detailed Description

File-based list utilities.

Created 11/28/1995 Heikki Tuuri

Function Documentation

◆ flst_get_first()

static fil_addr_t flst_get_first ( const flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Gets list first node address.

Returns
file address
Parameters
basein: pointer to base node
mtrin: mini-transaction handle

◆ flst_get_last()

static fil_addr_t flst_get_last ( const flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Gets list last node address.

Returns
file address
Parameters
basein: pointer to base node
mtrin: mini-transaction handle

◆ flst_get_len()

static ulint flst_get_len ( const flst_base_node_t base)
inlinestatic

Get the length of a list.

Parameters
[in]basebase node
Returns
length

◆ flst_get_next_addr()

static fil_addr_t flst_get_next_addr ( const flst_node_t node,
mtr_t mtr 
)
inlinestatic

Gets list next node address.

Returns
file address
Parameters
nodein: pointer to node
mtrin: mini-transaction handle

◆ flst_get_prev_addr()

static fil_addr_t flst_get_prev_addr ( const flst_node_t node,
mtr_t mtr 
)
inlinestatic

Gets list prev node address.

Returns
file address
Parameters
nodein: pointer to node
mtrin: mini-transaction handle

◆ flst_init()

static void flst_init ( flst_base_node_t base,
mtr_t mtr 
)
inlinestatic

Initializes a list base node.

Parameters
basein: pointer to base node
mtrin: mini-transaction handle

◆ flst_read_addr()

static fil_addr_t flst_read_addr ( const fil_faddr_t faddr,
mtr_t mtr 
)
inlinestatic

Reads a file address.

Returns
file address
Parameters
faddrin: pointer to file faddress
mtrin: mini-transaction handle

◆ flst_write_addr()

static void flst_write_addr ( fil_faddr_t faddr,
fil_addr_t  addr,
mtr_t mtr 
)
inlinestatic

Writes a file address.

Parameters
faddrin: pointer to file faddress
addrin: file address
mtrin: mini-transaction handle

Variable Documentation

◆ FLST_FIRST

constexpr uint32_t FLST_FIRST = 4
constexpr

6-byte address of the first element of the list; undefined if empty list

◆ FLST_LAST

constexpr uint32_t FLST_LAST = 4 + FIL_ADDR_SIZE
constexpr

6-byte address of the last element of the list; undefined if empty list

◆ FLST_LEN

constexpr uint32_t FLST_LEN = 0
constexpr

32-bit list length field

◆ FLST_NEXT

constexpr uint32_t FLST_NEXT = FIL_ADDR_SIZE
constexpr

◆ FLST_PREV

constexpr uint32_t FLST_PREV = 0
constexpr

6-byte address of the previous list element; the page part of address is FIL_NULL, if no previous element