Commit e9760189 authored by marko's avatar marko

branches/zip: Add const qualifiers or in/out comments to some function

parameters in log0log.
parent 184ee488
2009-03-20 The InnoDB Team
* include/log0log.h, include/log0log.ic, log/log0log.c:
Add in/out comments or const qualifiers to some function
parameters as appropriate.
2009-03-20 The InnoDB Team 2009-03-20 The InnoDB Team
* dict/dict0boot.c, dict/dict0dict.c, fsp/fsp0fsp.c, * dict/dict0boot.c, dict/dict0dict.c, fsp/fsp0fsp.c,
......
...@@ -261,10 +261,10 @@ UNIV_INTERN ...@@ -261,10 +261,10 @@ UNIV_INTERN
void void
log_checkpoint_get_nth_group_info( log_checkpoint_get_nth_group_info(
/*==============================*/ /*==============================*/
byte* buf, /* in: buffer containing checkpoint info */ const byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */ ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */ ulint* file_no,/* out: archived file number */
ulint* offset);/* out: archived file offset */ ulint* offset);/* out: archived file offset */
/********************************************************** /**********************************************************
Writes checkpoint info to groups. */ Writes checkpoint info to groups. */
UNIV_INTERN UNIV_INTERN
...@@ -382,7 +382,7 @@ UNIV_INTERN ...@@ -382,7 +382,7 @@ UNIV_INTERN
void void
log_group_set_fields( log_group_set_fields(
/*=================*/ /*=================*/
log_group_t* group, /* in: group */ log_group_t* group, /* in/out: group */
ib_uint64_t lsn); /* in: lsn for which the values should be ib_uint64_t lsn); /* in: lsn for which the values should be
set */ set */
/********************************************************** /**********************************************************
...@@ -392,42 +392,44 @@ UNIV_INTERN ...@@ -392,42 +392,44 @@ UNIV_INTERN
ulint ulint
log_group_get_capacity( log_group_get_capacity(
/*===================*/ /*===================*/
/* out: capacity in bytes */ /* out: capacity in bytes */
log_group_t* group); /* in: log group */ const log_group_t* group); /* in: log group */
/**************************************************************** /****************************************************************
Gets a log block flush bit. */ Gets a log block flush bit. */
UNIV_INLINE UNIV_INLINE
ibool ibool
log_block_get_flush_bit( log_block_get_flush_bit(
/*====================*/ /*====================*/
/* out: TRUE if this block was the first /* out: TRUE if this block was
to be written in a log flush */ the first to be written in a
byte* log_block); /* in: log block */ log flush */
const byte* log_block); /* in: log block */
/**************************************************************** /****************************************************************
Gets a log block number stored in the header. */ Gets a log block number stored in the header. */
UNIV_INLINE UNIV_INLINE
ulint ulint
log_block_get_hdr_no( log_block_get_hdr_no(
/*=================*/ /*=================*/
/* out: log block number stored in the block /* out: log block number
header */ stored in the block header */
byte* log_block); /* in: log block */ const byte* log_block); /* in: log block */
/**************************************************************** /****************************************************************
Gets a log block data length. */ Gets a log block data length. */
UNIV_INLINE UNIV_INLINE
ulint ulint
log_block_get_data_len( log_block_get_data_len(
/*===================*/ /*===================*/
/* out: log block data length measured as a /* out: log block data length
byte offset from the block start */ measured as a byte offset from
byte* log_block); /* in: log block */ the block start */
const byte* log_block); /* in: log block */
/**************************************************************** /****************************************************************
Sets the log block data length. */ Sets the log block data length. */
UNIV_INLINE UNIV_INLINE
void void
log_block_set_data_len( log_block_set_data_len(
/*===================*/ /*===================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint len); /* in: data length */ ulint len); /* in: data length */
/**************************************************************** /****************************************************************
Calculates the checksum for a log block. */ Calculates the checksum for a log block. */
...@@ -451,7 +453,7 @@ UNIV_INLINE ...@@ -451,7 +453,7 @@ UNIV_INLINE
void void
log_block_set_checksum( log_block_set_checksum(
/*===================*/ /*===================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint checksum); /* in: checksum */ ulint checksum); /* in: checksum */
/**************************************************************** /****************************************************************
Gets a log block first mtr log record group offset. */ Gets a log block first mtr log record group offset. */
...@@ -459,16 +461,17 @@ UNIV_INLINE ...@@ -459,16 +461,17 @@ UNIV_INLINE
ulint ulint
log_block_get_first_rec_group( log_block_get_first_rec_group(
/*==========================*/ /*==========================*/
/* out: first mtr log record group byte offset /* out: first mtr log record
from the block start, 0 if none */ group byte offset from the
byte* log_block); /* in: log block */ block start, 0 if none */
const byte* log_block); /* in: log block */
/**************************************************************** /****************************************************************
Sets the log block first mtr log record group offset. */ Sets the log block first mtr log record group offset. */
UNIV_INLINE UNIV_INLINE
void void
log_block_set_first_rec_group( log_block_set_first_rec_group(
/*==========================*/ /*==========================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint offset); /* in: offset, 0 if none */ ulint offset); /* in: offset, 0 if none */
/**************************************************************** /****************************************************************
Gets a log block checkpoint number field (4 lowest bytes). */ Gets a log block checkpoint number field (4 lowest bytes). */
...@@ -476,8 +479,9 @@ UNIV_INLINE ...@@ -476,8 +479,9 @@ UNIV_INLINE
ulint ulint
log_block_get_checkpoint_no( log_block_get_checkpoint_no(
/*========================*/ /*========================*/
/* out: checkpoint no (4 lowest bytes) */ /* out: checkpoint no (4
byte* log_block); /* in: log block */ lowest bytes) */
const byte* log_block); /* in: log block */
/**************************************************************** /****************************************************************
Initializes a log block in the log buffer. */ Initializes a log block in the log buffer. */
UNIV_INLINE UNIV_INLINE
......
...@@ -45,9 +45,10 @@ UNIV_INLINE ...@@ -45,9 +45,10 @@ UNIV_INLINE
ibool ibool
log_block_get_flush_bit( log_block_get_flush_bit(
/*====================*/ /*====================*/
/* out: TRUE if this block was the first /* out: TRUE if this block was
to be written in a log flush */ the first to be written in a
byte* log_block) /* in: log block */ log flush */
const byte* log_block) /* in: log block */
{ {
if (LOG_BLOCK_FLUSH_BIT_MASK if (LOG_BLOCK_FLUSH_BIT_MASK
& mach_read_from_4(log_block + LOG_BLOCK_HDR_NO)) { & mach_read_from_4(log_block + LOG_BLOCK_HDR_NO)) {
...@@ -64,7 +65,7 @@ UNIV_INLINE ...@@ -64,7 +65,7 @@ UNIV_INLINE
void void
log_block_set_flush_bit( log_block_set_flush_bit(
/*====================*/ /*====================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ibool val) /* in: value to set */ ibool val) /* in: value to set */
{ {
ulint field; ulint field;
...@@ -86,9 +87,9 @@ UNIV_INLINE ...@@ -86,9 +87,9 @@ UNIV_INLINE
ulint ulint
log_block_get_hdr_no( log_block_get_hdr_no(
/*=================*/ /*=================*/
/* out: log block number stored in the block /* out: log block number
header */ stored in the block header */
byte* log_block) /* in: log block */ const byte* log_block) /* in: log block */
{ {
return(~LOG_BLOCK_FLUSH_BIT_MASK return(~LOG_BLOCK_FLUSH_BIT_MASK
& mach_read_from_4(log_block + LOG_BLOCK_HDR_NO)); & mach_read_from_4(log_block + LOG_BLOCK_HDR_NO));
...@@ -101,7 +102,7 @@ UNIV_INLINE ...@@ -101,7 +102,7 @@ UNIV_INLINE
void void
log_block_set_hdr_no( log_block_set_hdr_no(
/*=================*/ /*=================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint n) /* in: log block number: must be > 0 and ulint n) /* in: log block number: must be > 0 and
< LOG_BLOCK_FLUSH_BIT_MASK */ < LOG_BLOCK_FLUSH_BIT_MASK */
{ {
...@@ -117,9 +118,10 @@ UNIV_INLINE ...@@ -117,9 +118,10 @@ UNIV_INLINE
ulint ulint
log_block_get_data_len( log_block_get_data_len(
/*===================*/ /*===================*/
/* out: log block data length measured as a /* out: log block data length
byte offset from the block start */ measured as a byte offset from
byte* log_block) /* in: log block */ the block start */
const byte* log_block) /* in: log block */
{ {
return(mach_read_from_2(log_block + LOG_BLOCK_HDR_DATA_LEN)); return(mach_read_from_2(log_block + LOG_BLOCK_HDR_DATA_LEN));
} }
...@@ -130,7 +132,7 @@ UNIV_INLINE ...@@ -130,7 +132,7 @@ UNIV_INLINE
void void
log_block_set_data_len( log_block_set_data_len(
/*===================*/ /*===================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint len) /* in: data length */ ulint len) /* in: data length */
{ {
mach_write_to_2(log_block + LOG_BLOCK_HDR_DATA_LEN, len); mach_write_to_2(log_block + LOG_BLOCK_HDR_DATA_LEN, len);
...@@ -142,9 +144,10 @@ UNIV_INLINE ...@@ -142,9 +144,10 @@ UNIV_INLINE
ulint ulint
log_block_get_first_rec_group( log_block_get_first_rec_group(
/*==========================*/ /*==========================*/
/* out: first mtr log record group byte offset /* out: first mtr log record
from the block start, 0 if none */ group byte offset from the
byte* log_block) /* in: log block */ block start, 0 if none */
const byte* log_block) /* in: log block */
{ {
return(mach_read_from_2(log_block + LOG_BLOCK_FIRST_REC_GROUP)); return(mach_read_from_2(log_block + LOG_BLOCK_FIRST_REC_GROUP));
} }
...@@ -155,7 +158,7 @@ UNIV_INLINE ...@@ -155,7 +158,7 @@ UNIV_INLINE
void void
log_block_set_first_rec_group( log_block_set_first_rec_group(
/*==========================*/ /*==========================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint offset) /* in: offset, 0 if none */ ulint offset) /* in: offset, 0 if none */
{ {
mach_write_to_2(log_block + LOG_BLOCK_FIRST_REC_GROUP, offset); mach_write_to_2(log_block + LOG_BLOCK_FIRST_REC_GROUP, offset);
...@@ -167,8 +170,9 @@ UNIV_INLINE ...@@ -167,8 +170,9 @@ UNIV_INLINE
ulint ulint
log_block_get_checkpoint_no( log_block_get_checkpoint_no(
/*========================*/ /*========================*/
/* out: checkpoint no (4 lowest bytes) */ /* out: checkpoint no (4
byte* log_block) /* in: log block */ lowest bytes) */
const byte* log_block) /* in: log block */
{ {
return(mach_read_from_4(log_block + LOG_BLOCK_CHECKPOINT_NO)); return(mach_read_from_4(log_block + LOG_BLOCK_CHECKPOINT_NO));
} }
...@@ -179,7 +183,7 @@ UNIV_INLINE ...@@ -179,7 +183,7 @@ UNIV_INLINE
void void
log_block_set_checkpoint_no( log_block_set_checkpoint_no(
/*========================*/ /*========================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ib_uint64_t no) /* in: checkpoint no */ ib_uint64_t no) /* in: checkpoint no */
{ {
mach_write_to_4(log_block + LOG_BLOCK_CHECKPOINT_NO, (ulint) no); mach_write_to_4(log_block + LOG_BLOCK_CHECKPOINT_NO, (ulint) no);
...@@ -247,7 +251,7 @@ UNIV_INLINE ...@@ -247,7 +251,7 @@ UNIV_INLINE
void void
log_block_set_checksum( log_block_set_checksum(
/*===================*/ /*===================*/
byte* log_block, /* in: log block */ byte* log_block, /* in/out: log block */
ulint checksum) /* in: checksum */ ulint checksum) /* in: checksum */
{ {
mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE mach_write_to_4(log_block + OS_FILE_LOG_BLOCK_SIZE
......
...@@ -468,8 +468,8 @@ UNIV_INTERN ...@@ -468,8 +468,8 @@ UNIV_INTERN
ulint ulint
log_group_get_capacity( log_group_get_capacity(
/*===================*/ /*===================*/
/* out: capacity in bytes */ /* out: capacity in bytes */
log_group_t* group) /* in: log group */ const log_group_t* group) /* in: log group */
{ {
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
...@@ -483,9 +483,10 @@ UNIV_INLINE ...@@ -483,9 +483,10 @@ UNIV_INLINE
ulint ulint
log_group_calc_size_offset( log_group_calc_size_offset(
/*=======================*/ /*=======================*/
/* out: size offset (<= offset) */ /* out: size offset (<= offset) */
ulint offset, /* in: real offset within the log group */ ulint offset, /* in: real offset within the
log_group_t* group) /* in: log group */ log group */
const log_group_t* group) /* in: log group */
{ {
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
...@@ -499,9 +500,10 @@ UNIV_INLINE ...@@ -499,9 +500,10 @@ UNIV_INLINE
ulint ulint
log_group_calc_real_offset( log_group_calc_real_offset(
/*=======================*/ /*=======================*/
/* out: real offset (>= offset) */ /* out: real offset (>= offset) */
ulint offset, /* in: size offset within the log group */ ulint offset, /* in: size offset within the
log_group_t* group) /* in: log group */ log group */
const log_group_t* group) /* in: log group */
{ {
ut_ad(mutex_own(&(log_sys->mutex))); ut_ad(mutex_own(&(log_sys->mutex)));
...@@ -515,10 +517,10 @@ static ...@@ -515,10 +517,10 @@ static
ulint ulint
log_group_calc_lsn_offset( log_group_calc_lsn_offset(
/*======================*/ /*======================*/
/* out: offset within the log group */ /* out: offset within the log group */
ib_uint64_t lsn, /* in: lsn, must be within 4 GB of ib_uint64_t lsn, /* in: lsn, must be within 4 GB of
group->lsn */ group->lsn */
log_group_t* group) /* in: log group */ const log_group_t* group) /* in: log group */
{ {
ib_uint64_t gr_lsn; ib_uint64_t gr_lsn;
ib_int64_t gr_lsn_size_offset; ib_int64_t gr_lsn_size_offset;
...@@ -1665,10 +1667,10 @@ UNIV_INTERN ...@@ -1665,10 +1667,10 @@ UNIV_INTERN
void void
log_checkpoint_get_nth_group_info( log_checkpoint_get_nth_group_info(
/*==============================*/ /*==============================*/
byte* buf, /* in: buffer containing checkpoint info */ const byte* buf, /* in: buffer containing checkpoint info */
ulint n, /* in: nth slot */ ulint n, /* in: nth slot */
ulint* file_no,/* out: archived file number */ ulint* file_no,/* out: archived file number */
ulint* offset) /* out: archived file offset */ ulint* offset) /* out: archived file offset */
{ {
ut_ad(n < LOG_MAX_N_GROUPS); ut_ad(n < LOG_MAX_N_GROUPS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment