Skip to content

File disk_manager.h

FileList > cubrid > src > storage > disk_manager.h

Go to the source code of this file

  • #include "config.h"
  • #include "error_manager.h"
  • #include "log_lsa.hpp"
  • #include "recovery.h"
  • #include "storage_common.h"
  • #include "thread_compat.hpp"

Classes

Type Name
struct disk_volmap_clone
struct disk_volume_space_info

Public Types

Type Name
enum DISK_FLUSH_TYPE
enum DISK_ISVALID
typedef struct disk_volmap_clone DISK_VOLMAP_CLONE
typedef struct disk_volume_space_info DISK_VOLUME_SPACE_INFO

Public Functions

Type Name
int disk_add_volume_extension (THREAD_ENTRY * thread_p, DB_VOLPURPOSE purpose, DB_VOLTYPE voltype, DKNPAGES npages, const char * path, const char * name, const char * comments, int max_write_size_in_sec, bool overwrite, VOLID * volid_out)
DISK_ISVALID disk_check (THREAD_ENTRY * thread_p, bool repair)
DISK_ISVALID disk_check_sectors_are_reserved (THREAD_ENTRY * thread_p, VSID * vsids, int nsects)
int disk_compare_vsids (const void * a, const void * b)
int disk_dump_all (THREAD_ENTRY * thread_p, FILE * fp)
int disk_format_first_volume (THREAD_ENTRY * thread_p, const char * full_dbname, const char * dbcomments, DKNPAGES npages)
HFID * disk_get_boot_hfid (THREAD_ENTRY * thread_p, INT16 volid, HFID * hfid)
int disk_get_checkpoint (THREAD_ENTRY * thread_p, INT16 volid, LOG_LSA * vol_lsa)
int disk_get_db_creation (THREAD_ENTRY * thread_p, INT16 volid, INT64 * db_creation)
char * disk_get_link (THREAD_ENTRY * thread_p, INT16 volid, INT16 * next_volid, char * next_volext_fullname)
INT32 disk_get_total_numsectors (THREAD_ENTRY * thread_p, INT16 volid)
DISK_ISVALID disk_is_page_sector_reserved (THREAD_ENTRY * thread_p, VOLID volid, PAGEID pageid)
DISK_ISVALID disk_is_page_sector_reserved_with_debug_crash (THREAD_ENTRY * thread_p, VOLID volid, PAGEID pageid, bool debug_crash)
void disk_lock_extend (void)
void disk_manager_final (void)
int disk_manager_init (THREAD_ENTRY * thread_p, bool load_form_disk)
DISK_ISVALID disk_map_clone_check_leaks (DISK_VOLMAP_CLONE * disk_map_clone)
DISK_ISVALID disk_map_clone_clear (VSID * vsid, DISK_VOLMAP_CLONE * disk_map_clone)
int disk_map_clone_create (THREAD_ENTRY * thread_p, DISK_VOLMAP_CLONE ** disk_map_clone)
void disk_map_clone_free (DISK_VOLMAP_CLONE ** disk_map_clone)
int disk_reserve_sectors (THREAD_ENTRY * thread_p, DB_VOLPURPOSE purpose, VOLID volid_hint, int n_sectors, VSID * reserved_sectors)
void disk_rv_dump_hdr (FILE * fp, int length_ignore, void * data)
void disk_rv_dump_init_map (FILE * fp, int length_ignore, void * data)
void disk_rv_dump_link (FILE * fp, int length_ignore, void * data)
void disk_rv_dump_set_boot_hfid (FILE * fp, int length_ignore, void * data)
void disk_rv_dump_set_creation_time (FILE * fp, int length_ignore, void * data)
void disk_rv_dump_volume_expand (FILE * fp, int length_ignore, void * data)
int disk_rv_redo_dboutside_newvol (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_redo_format (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_redo_init_map (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_redo_volume_expand (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_reserve_sectors (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_undo_format (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_undoredo_link (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_undoredo_set_boot_hfid (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_undoredo_set_creation_time (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_unreserve_sectors (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_volhead_extend_redo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_rv_volhead_extend_undo (THREAD_ENTRY * thread_p, LOG_RCV * rcv)
int disk_sectors_to_extend_npages (const int num_pages)
int disk_set_boot_hfid (THREAD_ENTRY * thread_p, INT16 volid, const HFID * hfid)
int disk_set_checkpoint (THREAD_ENTRY * thread_p, INT16 volid, const LOG_LSA * log_chkpt_lsa)
int disk_set_creation (THREAD_ENTRY * thread_p, INT16 volid, const char * new_vol_fullname, const INT64 * new_dbcreation, const LOG_LSA * new_chkptlsa, bool logchange, DISK_FLUSH_TYPE flush_page)
int disk_set_link (THREAD_ENTRY * thread_p, INT16 volid, INT16 next_volid, const char * next_volext_fullname, bool logchange, DISK_FLUSH_TYPE flush)
int disk_spacedb (THREAD_ENTRY * thread_p, SPACEDB_ALL * spaceall, SPACEDB_ONEVOL ** spacevols)
int disk_unformat (THREAD_ENTRY * thread_p, const char * vol_fullname)
void disk_unlock_extend (void)
int disk_unreserve_ordered_sectors (THREAD_ENTRY * thread_p, DB_VOLPURPOSE purpose, int nsects, VSID * vsids)
void disk_volheader_check_magic (THREAD_ENTRY * thread_p, const PAGE_PTR page_volheader)
int disk_volume_header_end_scan (THREAD_ENTRY * thread_p, void ** ctx)
SCAN_CODE disk_volume_header_next_scan (THREAD_ENTRY * thread_p, int cursor, DB_VALUE ** out_values, int out_cnt, void * ctx)
int disk_volume_header_start_scan (THREAD_ENTRY * thread_p, int type, DB_VALUE ** arg_values, int arg_cnt, void ** ctx)
INT16 xdisk_get_purpose_and_sys_lastpage (THREAD_ENTRY * thread_p, INT16 volid, DB_VOLPURPOSE * vol_purpose, INT32 * sys_lastpage)

Macros

Type Name
define DISK_PAGES_TO_SECTS (npages) ([**CEIL\_PTVDIV**](memory__alloc_8h.md#define-ceil_ptvdiv) (npages, [**DISK\_SECTOR\_NPAGES**](storage__common_8h.md#define-disk_sector_npages)))
define DISK_SECTS_NPAGES (nsects) ((nsects) \* [**DISK\_SECTOR\_NPAGES**](storage__common_8h.md#define-disk_sector_npages))
define DISK_SECTS_SIZE (nsects) (([**INT64**](broker__monitor_8c.md#function-timeout)) (nsects) \* [**IO\_SECTORSIZE**](storage__common_8h.md#define-io_sectorsize))
define DISK_VOLHEADER_PAGE 0 /\* [**Page**](broker__monitor_8c.md#function-timeout) [**of**](broker__monitor_8c.md#function-timeout) [**the**](broker__monitor_8c.md#function-timeout) volume header \*/
define DISK_VOLUME_SPACE_INFO_INITIALIZER { 0, 0, 0 }
define VSID_COPY (dest, src) \*(([**VSID**](dbtype__def_8h.md#typedef-vsid) \*) dest) = \*(([**VSID**](dbtype__def_8h.md#typedef-vsid) \*) src)
define VSID_EQ (first, second) ((first)->volid == (second)->volid && (first)->sectid == (second)->sectid)
define VSID_IS_NULL (vsidp) ((vsidp)->sectid == [**NULL\_SECTID**](storage__common_8h.md#define-null_sectid) \|\| (vsidp)->volid == [**NULL\_VOLID**](storage__common_8h.md#define-null_volid))
define VSID_SET_NULL (vsidp) (vsidp)->sectid = [**NULL\_SECTID**](storage__common_8h.md#define-null_sectid); (vsidp)->volid = [**NULL\_VOLID**](storage__common_8h.md#define-null_volid)

Public Types Documentation

enum DISK_FLUSH_TYPE

enum DISK_FLUSH_TYPE {
    DISK_DONT_FLUSH,
    DISK_FLUSH,
    DISK_FLUSH_AND_INVALIDATE
};

enum DISK_ISVALID

enum DISK_ISVALID {
    DISK_INVALID,
    DISK_VALID,
    DISK_ERROR
};

typedef DISK_VOLMAP_CLONE

typedef struct disk_volmap_clone DISK_VOLMAP_CLONE;

typedef DISK_VOLUME_SPACE_INFO

typedef struct disk_volume_space_info DISK_VOLUME_SPACE_INFO;

Public Functions Documentation

function disk_add_volume_extension

int disk_add_volume_extension (
    THREAD_ENTRY * thread_p,
    DB_VOLPURPOSE purpose,
    DB_VOLTYPE voltype,
    DKNPAGES npages,
    const  char * path,
    const  char * name,
    const  char * comments,
    int max_write_size_in_sec,
    bool overwrite,
    VOLID * volid_out
) 

function disk_check

DISK_ISVALID disk_check (
    THREAD_ENTRY * thread_p,
    bool repair
) 

function disk_check_sectors_are_reserved

DISK_ISVALID disk_check_sectors_are_reserved (
    THREAD_ENTRY * thread_p,
    VSID * vsids,
    int nsects
) 

function disk_compare_vsids

int disk_compare_vsids (
    const  void * a,
    const  void * b
) 

function disk_dump_all

int disk_dump_all (
    THREAD_ENTRY * thread_p,
    FILE * fp
) 

function disk_format_first_volume

int disk_format_first_volume (
    THREAD_ENTRY * thread_p,
    const  char * full_dbname,
    const  char * dbcomments,
    DKNPAGES npages
) 

function disk_get_boot_hfid

HFID * disk_get_boot_hfid (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    HFID * hfid
) 

function disk_get_checkpoint

int disk_get_checkpoint (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    LOG_LSA * vol_lsa
) 

function disk_get_db_creation

int disk_get_db_creation (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    INT64 * db_creation
) 

char * disk_get_link (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    INT16 * next_volid,
    char * next_volext_fullname
) 

function disk_get_total_numsectors

INT32 disk_get_total_numsectors (
    THREAD_ENTRY * thread_p,
    INT16 volid
) 

function disk_is_page_sector_reserved

DISK_ISVALID disk_is_page_sector_reserved (
    THREAD_ENTRY * thread_p,
    VOLID volid,
    PAGEID pageid
) 

function disk_is_page_sector_reserved_with_debug_crash

DISK_ISVALID disk_is_page_sector_reserved_with_debug_crash (
    THREAD_ENTRY * thread_p,
    VOLID volid,
    PAGEID pageid,
    bool debug_crash
) 

function disk_lock_extend

void disk_lock_extend (
    void
) 

function disk_manager_final

void disk_manager_final (
    void
) 

function disk_manager_init

int disk_manager_init (
    THREAD_ENTRY * thread_p,
    bool load_form_disk
) 

function disk_map_clone_check_leaks

DISK_ISVALID disk_map_clone_check_leaks (
    DISK_VOLMAP_CLONE * disk_map_clone
) 

function disk_map_clone_clear

DISK_ISVALID disk_map_clone_clear (
    VSID * vsid,
    DISK_VOLMAP_CLONE * disk_map_clone
) 

function disk_map_clone_create

int disk_map_clone_create (
    THREAD_ENTRY * thread_p,
    DISK_VOLMAP_CLONE ** disk_map_clone
) 

function disk_map_clone_free

void disk_map_clone_free (
    DISK_VOLMAP_CLONE ** disk_map_clone
) 

function disk_reserve_sectors

int disk_reserve_sectors (
    THREAD_ENTRY * thread_p,
    DB_VOLPURPOSE purpose,
    VOLID volid_hint,
    int n_sectors,
    VSID * reserved_sectors
) 

function disk_rv_dump_hdr

void disk_rv_dump_hdr (
    FILE * fp,
    int length_ignore,
    void * data
) 

function disk_rv_dump_init_map

void disk_rv_dump_init_map (
    FILE * fp,
    int length_ignore,
    void * data
) 

void disk_rv_dump_link (
    FILE * fp,
    int length_ignore,
    void * data
) 

function disk_rv_dump_set_boot_hfid

void disk_rv_dump_set_boot_hfid (
    FILE * fp,
    int length_ignore,
    void * data
) 

function disk_rv_dump_set_creation_time

void disk_rv_dump_set_creation_time (
    FILE * fp,
    int length_ignore,
    void * data
) 

function disk_rv_dump_volume_expand

void disk_rv_dump_volume_expand (
    FILE * fp,
    int length_ignore,
    void * data
) 

function disk_rv_redo_dboutside_newvol

int disk_rv_redo_dboutside_newvol (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_redo_format

int disk_rv_redo_format (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_redo_init_map

int disk_rv_redo_init_map (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_redo_volume_expand

int disk_rv_redo_volume_expand (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_reserve_sectors

int disk_rv_reserve_sectors (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_undo_format

int disk_rv_undo_format (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

int disk_rv_undoredo_link (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_undoredo_set_boot_hfid

int disk_rv_undoredo_set_boot_hfid (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_undoredo_set_creation_time

int disk_rv_undoredo_set_creation_time (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_unreserve_sectors

int disk_rv_unreserve_sectors (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_volhead_extend_redo

int disk_rv_volhead_extend_redo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_rv_volhead_extend_undo

int disk_rv_volhead_extend_undo (
    THREAD_ENTRY * thread_p,
    LOG_RCV * rcv
) 

function disk_sectors_to_extend_npages

int disk_sectors_to_extend_npages (
    const  int num_pages
) 

function disk_set_boot_hfid

int disk_set_boot_hfid (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    const  HFID * hfid
) 

function disk_set_checkpoint

int disk_set_checkpoint (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    const  LOG_LSA * log_chkpt_lsa
) 

function disk_set_creation

int disk_set_creation (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    const  char * new_vol_fullname,
    const  INT64 * new_dbcreation,
    const  LOG_LSA * new_chkptlsa,
    bool logchange,
    DISK_FLUSH_TYPE flush_page
) 

int disk_set_link (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    INT16 next_volid,
    const  char * next_volext_fullname,
    bool logchange,
    DISK_FLUSH_TYPE flush
) 

function disk_spacedb

int disk_spacedb (
    THREAD_ENTRY * thread_p,
    SPACEDB_ALL * spaceall,
    SPACEDB_ONEVOL ** spacevols
) 

function disk_unformat

int disk_unformat (
    THREAD_ENTRY * thread_p,
    const  char * vol_fullname
) 

function disk_unlock_extend

void disk_unlock_extend (
    void
) 

function disk_unreserve_ordered_sectors

int disk_unreserve_ordered_sectors (
    THREAD_ENTRY * thread_p,
    DB_VOLPURPOSE purpose,
    int nsects,
    VSID * vsids
) 

function disk_volheader_check_magic

void disk_volheader_check_magic (
    THREAD_ENTRY * thread_p,
    const  PAGE_PTR page_volheader
) 

function disk_volume_header_end_scan

int disk_volume_header_end_scan (
    THREAD_ENTRY * thread_p,
    void ** ctx
) 

function disk_volume_header_next_scan

SCAN_CODE disk_volume_header_next_scan (
    THREAD_ENTRY * thread_p,
    int cursor,
    DB_VALUE ** out_values,
    int out_cnt,
    void * ctx
) 

function disk_volume_header_start_scan

int disk_volume_header_start_scan (
    THREAD_ENTRY * thread_p,
    int type,
    DB_VALUE ** arg_values,
    int arg_cnt,
    void ** ctx
) 

function xdisk_get_purpose_and_sys_lastpage

INT16 xdisk_get_purpose_and_sys_lastpage (
    THREAD_ENTRY * thread_p,
    INT16 volid,
    DB_VOLPURPOSE * vol_purpose,
    INT32 * sys_lastpage
) 

Macro Definition Documentation

define DISK_PAGES_TO_SECTS

#define DISK_PAGES_TO_SECTS (
    npages
) `( CEIL_PTVDIV (npages, DISK_SECTOR_NPAGES ))`

define DISK_SECTS_NPAGES

#define DISK_SECTS_NPAGES (
    nsects
) `((nsects) * DISK_SECTOR_NPAGES )`

define DISK_SECTS_SIZE

#define DISK_SECTS_SIZE (
    nsects
) `(( INT64 ) (nsects) * IO_SECTORSIZE )`

define DISK_VOLHEADER_PAGE

#define DISK_VOLHEADER_PAGE `0  /* Page  of  the volume header */`

define DISK_VOLUME_SPACE_INFO_INITIALIZER

#define DISK_VOLUME_SPACE_INFO_INITIALIZER `{ 0, 0, 0 }`

define VSID_COPY

#define VSID_COPY (
    dest,
    src
) `*(( VSID *) dest) = *(( VSID *) src)`

define VSID_EQ

#define VSID_EQ (
    first,
    second
) `((first)->volid == (second)->volid && (first)->sectid == (second)->sectid)`

define VSID_IS_NULL

#define VSID_IS_NULL (
    vsidp
) `((vsidp)->sectid == NULL_SECTID || (vsidp)->volid == NULL_VOLID )`

define VSID_SET_NULL

#define VSID_SET_NULL (
    vsidp
) `(vsidp)->sectid = NULL_SECTID ; (vsidp)->volid = NULL_VOLID`


The documentation for this class was generated from the following file cubrid/src/storage/disk_manager.h