Code clean-up related to MDEV-13167

xdes_get_descriptor_const(): New function, to get read-only access to
the allocation descriptor.

fseg_page_is_free(): Only acquire a shared latch on the tablespace,
not an exclusive latch. Calculate the descriptor page address before
acquiring the tablespace latch. If the page number is out of bounds,
return without fetching any page. Access only one descriptor page.

fsp_page_is_free(), fsp_page_is_free_func(): Remove.
Use fseg_page_is_free() instead.

fsp_init_file_page(): Move the debug parameter into a separate function.

btr_validate_level(): Remove the unused variable "seg".
This commit is contained in:
Marko Mäkelä 2017-08-23 09:47:50 +03:00
commit e52dd13c2e
4 changed files with 89 additions and 101 deletions

View file

@ -1723,7 +1723,7 @@ btr_scrub_get_block_and_allocation_status(
mtr_start(&local_mtr);
*allocation_status = fsp_page_is_free(space->id, offset, &local_mtr) ?
*allocation_status = fseg_page_is_free(space, offset) ?
BTR_SCRUB_PAGE_FREE :
BTR_SCRUB_PAGE_ALLOCATED;