InnoDB Plugin  1.0
Functions
log0log.ic File Reference
#include "os0file.h"
#include "mach0data.h"
#include "mtr0mtr.h"
#include "srv0mon.h"
Include dependency graph for log0log.ic:
This graph shows which files directly or indirectly include this file:

Functions

UNIV_INLINE ibool log_block_get_flush_bit (const byte *log_block)
UNIV_INLINE void log_block_set_flush_bit (byte *log_block, ibool val)
UNIV_INLINE ulint log_block_get_hdr_no (const byte *log_block)
UNIV_INLINE void log_block_set_hdr_no (byte *log_block, ulint n)
UNIV_INLINE ulint log_block_get_data_len (const byte *log_block)
UNIV_INLINE void log_block_set_data_len (byte *log_block, ulint len)
UNIV_INLINE ulint log_block_get_first_rec_group (const byte *log_block)
UNIV_INLINE void log_block_set_first_rec_group (byte *log_block, ulint offset)
UNIV_INLINE ulint log_block_get_checkpoint_no (const byte *log_block)
UNIV_INLINE void log_block_set_checkpoint_no (byte *log_block, ib_uint64_t no)
UNIV_INLINE ulint log_block_convert_lsn_to_no (lsn_t lsn)
UNIV_INLINE ulint log_block_calc_checksum (const byte *block)
UNIV_INLINE ulint log_block_get_checksum (const byte *log_block)
UNIV_INLINE void log_block_set_checksum (byte *log_block, ulint checksum)
UNIV_INLINE void log_block_init (byte *log_block, lsn_t lsn)
UNIV_INLINE void log_block_init_in_old_format (byte *log_block, lsn_t lsn)
UNIV_INLINE lsn_t log_reserve_and_write_fast (const void *str, ulint len, lsn_t *start_lsn)
UNIV_INLINE void log_release (void)
UNIV_INLINE lsn_t log_get_lsn (void)
UNIV_INLINE lsn_t log_get_capacity (void)
UNIV_INLINE lsn_t log_get_max_modified_age_async (void)
UNIV_INLINE void log_free_check (void)

Detailed Description

Database log

Created 12/9/1995 Heikki Tuuri

Function Documentation

UNIV_INLINE ulint log_block_calc_checksum ( const byte *  block)

Calculates the checksum for a log block.

Returns
checksum
Parameters
blockin: log block
UNIV_INLINE ulint log_block_convert_lsn_to_no ( lsn_t  lsn)

Converts a lsn to a log block number.

Returns
log block number, it is > 0 and <= 1G
Parameters
lsnin: lsn of a byte within the block
UNIV_INLINE ulint log_block_get_checkpoint_no ( const byte *  log_block)

Gets a log block checkpoint number field (4 lowest bytes).

Returns
checkpoint no (4 lowest bytes)
Parameters
log_blockin: log block
UNIV_INLINE ulint log_block_get_checksum ( const byte *  log_block)

Gets a log block checksum field value.

Returns
checksum
Parameters
log_blockin: log block
UNIV_INLINE ulint log_block_get_data_len ( const byte *  log_block)

Gets a log block data length.

Returns
log block data length measured as a byte offset from the block start
Parameters
log_blockin: log block
UNIV_INLINE ulint log_block_get_first_rec_group ( const byte *  log_block)

Gets a log block first mtr log record group offset.

Returns
first mtr log record group byte offset from the block start, 0 if none
Parameters
log_blockin: log block
UNIV_INLINE ibool log_block_get_flush_bit ( const byte *  log_block)

Gets a log block flush bit.

Returns
TRUE if this block was the first to be written in a log flush
Parameters
log_blockin: log block
UNIV_INLINE ulint log_block_get_hdr_no ( const byte *  log_block)

Gets a log block number stored in the header.

Returns
log block number stored in the block header
Parameters
log_blockin: log block
UNIV_INLINE void log_block_init ( byte *  log_block,
lsn_t  lsn 
)

Initializes a log block in the log buffer.

Parameters
log_blockin: pointer to the log buffer
lsnin: lsn within the log block
UNIV_INLINE void log_block_init_in_old_format ( byte *  log_block,
lsn_t  lsn 
)

Initializes a log block in the log buffer in the old format, where there was no checksum yet.

Parameters
log_blockin: pointer to the log buffer
lsnin: lsn within the log block
UNIV_INLINE void log_block_set_checkpoint_no ( byte *  log_block,
ib_uint64_t  no 
)

Sets a log block checkpoint number field (4 lowest bytes).

Parameters
log_blockin/out: log block
noin: checkpoint no
UNIV_INLINE void log_block_set_checksum ( byte *  log_block,
ulint  checksum 
)

Sets a log block checksum field value.

Parameters
log_blockin/out: log block
checksumin: checksum
UNIV_INLINE void log_block_set_data_len ( byte *  log_block,
ulint  len 
)

Sets the log block data length.

Parameters
log_blockin/out: log block
lenin: data length
UNIV_INLINE void log_block_set_first_rec_group ( byte *  log_block,
ulint  offset 
)

Sets the log block first mtr log record group offset.

Parameters
log_blockin/out: log block
offsetin: offset, 0 if none
UNIV_INLINE void log_block_set_flush_bit ( byte *  log_block,
ibool  val 
)

Sets the log block flush bit.

Parameters
log_blockin/out: log block
valin: value to set
UNIV_INLINE void log_block_set_hdr_no ( byte *  log_block,
ulint  n 
)

Sets the log block number stored in the header; NOTE that this must be set before the flush bit!

Parameters
log_blockin/out: log block
nin: log block number: must be > 0 and < LOG_BLOCK_FLUSH_BIT_MASK
UNIV_INLINE void log_free_check ( void  )

Checks if there is need for a log buffer flush or a new checkpoint, and does this if yes. Any database operation should call this when it has modified more than about 4 pages. NOTE that this function may only be called when the OS thread owns no synchronization objects except the dictionary mutex.

UNIV_INLINE lsn_t log_get_lsn ( void  )

Gets the current lsn.

Returns
current lsn
UNIV_INLINE void log_release ( void  )

Releases the log mutex.

UNIV_INLINE lsn_t log_reserve_and_write_fast ( const void *  str,
ulint  len,
lsn_t *  start_lsn 
)

Writes to the log the string given. The log must be released with log_release.

Returns
end lsn of the log record, zero if did not succeed
Parameters
strin: string
lenin: string length
start_lsnout: start lsn of the log record