CUBRID Engine  latest
disk_manager.c File Reference
#include "config.h"
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <assert.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "disk_manager.h"
#include "porting.h"
#include "porting_inline.hpp"
#include "system_parameter.h"
#include "error_manager.h"
#include "language_support.h"
#include "intl_support.h"
#include "xserver_interface.h"
#include "file_io.h"
#include "page_buffer.h"
#include "log_append.hpp"
#include "log_manager.h"
#include "log_lsa.hpp"
#include "log_volids.hpp"
#include "critical_section.h"
#include "boot_sr.h"
#include "tz_support.h"
#include "db_date.h"
#include "bit.h"
#include "fault_injection.h"
#include "vacuum.h"
#include "dbtype.h"
#include "thread_daemon.hpp"
#include "thread_entry_task.hpp"
#include "thread_manager.hpp"
#include "double_write_buffer.h"

Go to the source code of this file.

Classes

struct  disk_volume_header
 
struct  disk_recv_link_perm_volume
 
struct  disk_recv_change_creation
 
struct  disk_recv_data_volume_expand
 
struct  disk_vol_header_context
 
struct  disk_check_vol_info
 
struct  disk_cache_volinfo
 
struct  disk_extend_info
 
struct  disk_perm_info
 
struct  disk_temp_info
 
struct  disk_cache
 
struct  disk_stab_cursor
 
struct  disk_cache_vol_reserve
 
struct  disk_reserve_context
 

Macros

#define DISK_STAB_UNIT_SIZE_OF   sizeof (DISK_STAB_UNIT)
 
#define DISK_STAB_CURSOR_INITIALIZER   { NULL, 0, 0, 0, 0, NULL, NULL }
 
#define DISK_STAB_UNIT_BIT_COUNT   ((int) (DISK_STAB_UNIT_SIZE_OF * CHAR_BIT))
 
#define DISK_STAB_PAGE_UNITS_COUNT   ((int) (DB_PAGESIZE / DISK_STAB_UNIT_SIZE_OF))
 
#define DISK_STAB_PAGE_BIT_COUNT   ((int) (DISK_STAB_UNIT_BIT_COUNT * DISK_STAB_PAGE_UNITS_COUNT))
 
#define DISK_ALLOCTBL_SECTOR_PAGE_OFFSET(sect)   ((sect) / DISK_STAB_PAGE_BIT_COUNT)
 
#define DISK_ALLOCTBL_SECTOR_UNIT_OFFSET(sect)   (((sect) % DISK_STAB_PAGE_BIT_COUNT) / DISK_STAB_UNIT_BIT_COUNT)
 
#define DISK_ALLOCTBL_SECTOR_BIT_OFFSET(sect)   (((sect) % DISK_STAB_PAGE_BIT_COUNT) % DISK_STAB_UNIT_BIT_COUNT)
 
#define DISK_SECTS_ROUND_UP(nsects)   (CEIL_PTVDIV (nsects, DISK_STAB_UNIT_BIT_COUNT) * DISK_STAB_UNIT_BIT_COUNT)
 
#define DISK_SECTS_ROUND_DOWN(nsects)   ((nsects / DISK_STAB_UNIT_BIT_COUNT) * DISK_STAB_UNIT_BIT_COUNT)
 
#define DISK_SECTS_ASSERT_ROUNDED(nsects)   assert (nsects == DISK_SECTS_ROUND_DOWN (nsects))
 
#define DISK_STAB_NPAGES(nsect_max)   (CEIL_PTVDIV (nsect_max, DISK_STAB_PAGE_BIT_COUNT))
 
#define DISK_PRERESERVE_BUF_DEFAULT   16
 
#define DISK_MIN_VOLUME_SECTS   DISK_STAB_UNIT_BIT_COUNT
 
#define DISK_SAFE_OSDISK_FREE_SPACE   (64 * 1024 * 1024)
 
#define DISK_SAFE_OSDISK_FREE_SECTS   (DISK_SAFE_OSDISK_FREE_SPACE / IO_SECTORSIZE)
 
#define disk_log(func, msg, ...)
 
#define DISK_VOLHEADER_MSG
 
#define DISK_VOLHEADER_AS_ARGS(arg_volh)
 
#define DISK_RESERVE_CONTEXT_MSG
 
#define DISK_RESERVE_CONTEXT_AS_ARGS(context)
 
#define DISK_SYS_NPAGE_SIZE(nsect_max)   (1 + DISK_STAB_NPAGES (nsect_max))
 
#define DISK_SYS_NSECT_SIZE(nsect_max)   (CEIL_PTVDIV (DISK_SYS_NPAGE_SIZE (nsect_max), DISK_SECTOR_NPAGES))
 
#define disk_get_volheader(...)   disk_get_volheader_internal (__VA_ARGS__, ARG_FILE_LINE)
 
#define fault_inject_random_crash()   if (vol_purpose == DB_PERMANENT_DATA_PURPOSE) FI_TEST (thread_p, FI_TEST_DISK_MANAGER_VOLUME_ADD, 0)
 

Typedefs

typedef struct disk_volume_header DISK_VOLUME_HEADER
 
typedef struct disk_recv_link_perm_volume DISK_RECV_LINK_PERM_VOLUME
 
typedef struct disk_recv_change_creation DISK_RECV_CHANGE_CREATION
 
typedef struct disk_recv_data_volume_expand DISK_RECV_DATA_VOLUME_EXPAND
 
typedef struct disk_vol_header_context DISK_VOL_HEADER_CONTEXT
 
typedef struct disk_check_vol_info DISK_CHECK_VOL_INFO
 
typedef struct disk_cache_volinfo DISK_CACHE_VOLINFO
 
typedef struct disk_extend_info DISK_EXTEND_INFO
 
typedef struct disk_perm_info DISK_PERM_PURPOSE_INFO
 
typedef struct disk_temp_info DISK_TEMP_PURPOSE_INFO
 
typedef struct disk_cache DISK_CACHE
 
typedef UINT64 DISK_STAB_UNIT
 
typedef struct disk_stab_cursor DISK_STAB_CURSOR
 
typedef int(* DISK_STAB_UNIT_FUNC) (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
typedef struct disk_cache_vol_reserve DISK_CACHE_VOL_RESERVE
 
typedef struct disk_reserve_context DISK_RESERVE_CONTEXT
 

Functions

STATIC_INLINE char * disk_vhdr_get_vol_fullname (const DISK_VOLUME_HEADER *vhdr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE char * disk_vhdr_get_next_vol_fullname (const DISK_VOLUME_HEADER *vhdr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE char * disk_vhdr_get_vol_remarks (const DISK_VOLUME_HEADER *vhdr) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int disk_vhdr_length_of_varfields (const DISK_VOLUME_HEADER *vhdr) __attribute__((ALWAYS_INLINE))
 
static int disk_vhdr_set_vol_fullname (DISK_VOLUME_HEADER *vhdr, const char *vol_fullname)
 
static int disk_vhdr_set_next_vol_fullname (DISK_VOLUME_HEADER *vhdr, const char *next_vol_fullname)
 
static int disk_vhdr_set_vol_remarks (DISK_VOLUME_HEADER *vhdr, const char *vol_remarks)
 
static bool disk_cache_load_all_volumes (THREAD_ENTRY *thread_p)
 
static bool disk_cache_load_volume (THREAD_ENTRY *thread_p, INT16 volid, void *ignore)
 
static const char * disk_purpose_to_string (DISK_VOLPURPOSE purpose)
 
static const char * disk_type_to_string (DB_VOLTYPE voltype)
 
static int disk_stab_dump (THREAD_ENTRY *thread_p, FILE *fp, const DISK_VOLUME_HEADER *volheader)
 
static int disk_dump_volume_system_info (THREAD_ENTRY *thread_p, FILE *fp, INT16 volid)
 
static bool disk_dump_goodvol_all (THREAD_ENTRY *thread_p, INT16 volid, void *ignore)
 
static void disk_vhdr_dump (FILE *fp, const DISK_VOLUME_HEADER *vhdr)
 
STATIC_INLINE void disk_verify_volume_header (THREAD_ENTRY *thread_p, PAGE_PTR pgptr) __attribute__((ALWAYS_INLINE))
 
static bool disk_check_volume_exist (THREAD_ENTRY *thread_p, VOLID volid, void *arg)
 
static int disk_can_overwrite_data_volume (THREAD_ENTRY *thread_p, const char *vol_label_p, bool *can_overwrite)
 
STATIC_INLINE void disk_stab_cursor_set_at_sectid (const DISK_VOLUME_HEADER *volheader, SECTID sectid, DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_set_at_end (const DISK_VOLUME_HEADER *volheader, DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_set_at_start (const DISK_VOLUME_HEADER *volheader, DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int disk_stab_cursor_compare (const DISK_STAB_CURSOR *first_cursor, const DISK_STAB_CURSOR *second_cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_check_valid (const DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE bool disk_stab_cursor_is_bit_set (const DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_set_bit (DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_clear_bit (DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int disk_stab_cursor_get_bit_index_in_page (const DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE SECTID disk_stab_cursor_get_sectid (const DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE int disk_stab_cursor_fix (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, PGBUF_LATCH_MODE latch_mode) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_stab_cursor_unfix (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor) __attribute__((ALWAYS_INLINE))
 
static int disk_stab_unit_reserve (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static int disk_stab_iterate_units (THREAD_ENTRY *thread_p, const DISK_VOLUME_HEADER *volheader, PGBUF_LATCH_MODE mode, DISK_STAB_CURSOR *start, DISK_STAB_CURSOR *end, DISK_STAB_UNIT_FUNC f_unit, void *f_unit_args)
 
static int disk_stab_iterate_units_all (THREAD_ENTRY *thread_p, const DISK_VOLUME_HEADER *volheader, PGBUF_LATCH_MODE mode, DISK_STAB_UNIT_FUNC f_unit, void *f_unit_args)
 
static int disk_stab_dump_unit (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static int disk_stab_count_free (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static int disk_stab_set_bits_contiguous (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static int disk_volume_boot (THREAD_ENTRY *thread_p, VOLID volid, DB_VOLPURPOSE *purpose_out, DB_VOLTYPE *voltype_out, DISK_VOLUME_SPACE_INFO *space_out)
 
STATIC_INLINE void disk_cache_lock_reserve (DISK_EXTEND_INFO *expand_info) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_cache_unlock_reserve (DISK_EXTEND_INFO *expand_info) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_cache_lock_reserve_for_purpose (DB_VOLPURPOSE purpose) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_cache_unlock_reserve_for_purpose (DB_VOLPURPOSE purpose) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_cache_update_vol_free (VOLID volid, DKNSECTS delta_free) __attribute__((ALWAYS_INLINE))
 
static int disk_reserve_sectors_in_volume (THREAD_ENTRY *thread_p, int vol_index, DISK_RESERVE_CONTEXT *context)
 
static DISK_ISVALID disk_is_sector_reserved (THREAD_ENTRY *thread_p, const DISK_VOLUME_HEADER *volheader, SECTID sectid, bool debug_crash)
 
static int disk_reserve_from_cache (THREAD_ENTRY *thread_p, DISK_RESERVE_CONTEXT *context, bool *did_extend)
 
STATIC_INLINE void disk_reserve_from_cache_vols (DB_VOLTYPE type, DISK_RESERVE_CONTEXT *context) __attribute__((ALWAYS_INLINE))
 
static int disk_extend (THREAD_ENTRY *thread_p, DISK_EXTEND_INFO *expand_info, DISK_RESERVE_CONTEXT *reserve_context)
 
static int disk_volume_expand (THREAD_ENTRY *thread_p, VOLID volid, DB_VOLTYPE voltype, DKNSECTS nsect_extend, DKNSECTS *nsect_extended_out)
 
static int disk_add_volume (THREAD_ENTRY *thread_p, DBDEF_VOL_EXT_INFO *extinfo, VOLID *volid_out, DKNSECTS *nsects_free_out)
 
STATIC_INLINE void disk_reserve_from_cache_volume (VOLID volid, DISK_RESERVE_CONTEXT *context) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_cache_free_reserved (DISK_RESERVE_CONTEXT *context) __attribute__((ALWAYS_INLINE))
 
static int disk_unreserve_ordered_sectors_without_csect (THREAD_ENTRY *thread_p, DB_VOLPURPOSE purpose, int nsects, VSID *vsids)
 
static int disk_unreserve_sectors_from_volume (THREAD_ENTRY *thread_p, VOLID volid, DISK_RESERVE_CONTEXT *context)
 
static int disk_stab_unit_unreserve (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static DISK_ISVALID disk_check_sectors_are_reserved_in_volume (THREAD_ENTRY *thread_p, VOLID volid, DISK_RESERVE_CONTEXT *context)
 
static int disk_stab_unit_check_reserved (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)
 
static int disk_stab_init (THREAD_ENTRY *thread_p, DISK_VOLUME_HEADER *volheader)
 
STATIC_INLINE void disk_volume_header_set_stab (DB_VOLPURPOSE vol_purpose, DISK_VOLUME_HEADER *volheader) __attribute__((ALWAYS_INLINE))
 
static int disk_format (THREAD_ENTRY *thread_p, const char *dbname, INT16 volid, DBDEF_VOL_EXT_INFO *ext_info, DKNSECTS *nsect_free_out)
 
STATIC_INLINE int disk_get_volheader_internal (THREAD_ENTRY *thread_p, VOLID volid, PGBUF_LATCH_MODE latch_mode, PAGE_PTR *page_volheader_out, DISK_VOLUME_HEADER **volheader_out, const char *file, int line) __attribute__((ALWAYS_INLINE))
 
static int disk_cache_init (void)
 
static void disk_cache_final (void)
 
STATIC_INLINE bool disk_is_valid_volid (VOLID volid) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE DB_VOLPURPOSE disk_get_volpurpose (VOLID volid) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE DB_VOLTYPE disk_get_voltype (VOLID volid) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE bool disk_compatible_type_and_purpose (DB_VOLTYPE type, DB_VOLPURPOSE purpose) __attribute__((ALWAYS_INLINE))
 
STATIC_INLINE void disk_check_own_reserve_for_purpose (DB_VOLPURPOSE purpose) __attribute__((ALWAYS_INLINE))
 
static DISK_ISVALID disk_check_volume (THREAD_ENTRY *thread_p, INT16 volid, bool repair)
 
static void disk_auto_volume_expansion_daemon_init ()
 
static void disk_auto_volume_expansion_daemon_destroy ()
 
int disk_unformat (THREAD_ENTRY *thread_p, const char *vol_fullname)
 
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)
 
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_set_boot_hfid (THREAD_ENTRY *thread_p, INT16 volid, const HFID *hfid)
 
HFIDdisk_get_boot_hfid (THREAD_ENTRY *thread_p, INT16 volid, HFID *hfid)
 
char * disk_get_link (THREAD_ENTRY *thread_p, INT16 volid, INT16 *next_volid, char *next_volext_fullname)
 
int disk_rv_redo_dboutside_newvol (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int disk_rv_undo_format (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int disk_rv_redo_format (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_hdr (FILE *fp, int length_ignore, void *data)
 
int disk_rv_redo_init_map (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_init_map (FILE *fp, int length_ignore, void *data)
 
int disk_rv_undoredo_set_creation_time (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_set_creation_time (FILE *fp, int length_ignore, void *data)
 
int disk_rv_undoredo_link (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_link (FILE *fp, int length_ignore, void *data)
 
int disk_rv_undoredo_set_boot_hfid (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_set_boot_hfid (FILE *fp, int length_ignore, void *data)
 
int disk_rv_redo_volume_expand (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
void disk_rv_dump_volume_expand (FILE *fp, int length_ignore, void *data)
 
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_add_volume_extension (THREAD_ENTRY *thread_p, DB_VOLPURPOSE purpose, DKNPAGES npages, const char *path, const char *name, const char *comments, int max_write_size_in_sec, bool overwrite, VOLID *volid_out)
 
void disk_lock_extend (void)
 
void disk_unlock_extend (void)
 
int disk_volume_header_start_scan (THREAD_ENTRY *thread_p, int type, DB_VALUE **arg_values, int arg_cnt, void **ptr)
 
SCAN_CODE disk_volume_header_next_scan (THREAD_ENTRY *thread_p, int cursor, DB_VALUE **out_values, int out_cnt, void *ptr)
 
int disk_volume_header_end_scan (THREAD_ENTRY *thread_p, void **ptr)
 
int disk_rv_reserve_sectors (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
int disk_rv_unreserve_sectors (THREAD_ENTRY *thread_p, LOG_RCV *rcv)
 
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)
 
int disk_reserve_sectors (THREAD_ENTRY *thread_p, DB_VOLPURPOSE purpose, VOLID volid_hint, int n_sectors, VSID *reserved_sectors)
 
int disk_unreserve_ordered_sectors (THREAD_ENTRY *thread_p, DB_VOLPURPOSE purpose, int nsects, VSID *vsids)
 
int disk_manager_init (THREAD_ENTRY *thread_p, bool load_from_disk)
 
void disk_manager_final (void)
 
int disk_format_first_volume (THREAD_ENTRY *thread_p, const char *full_dbname, const char *dbcomments, DKNPAGES npages)
 
DISK_ISVALID disk_check_sectors_are_reserved (THREAD_ENTRY *thread_p, VSID *vsids, int nsects)
 
int disk_set_checkpoint (THREAD_ENTRY *thread_p, INT16 volid, const LOG_LSA *log_chkpt_lsa)
 
int disk_get_checkpoint (THREAD_ENTRY *thread_p, INT16 volid, LOG_LSA *vol_lsa)
 
int disk_get_creation_time (THREAD_ENTRY *thread_p, INT16 volid, INT64 *db_creation)
 
DISK_VOLPURPOSE xdisk_get_purpose (THREAD_ENTRY *thread_p, INT16 volid)
 
int xdisk_get_purpose_and_space_info (THREAD_ENTRY *thread_p, VOLID volid, DISK_VOLPURPOSE *vol_purpose, DISK_VOLUME_SPACE_INFO *space_info)
 
INT16 xdisk_get_purpose_and_sys_lastpage (THREAD_ENTRY *thread_p, INT16 volid, DISK_VOLPURPOSE *vol_purpose, INT32 *sys_lastpage)
 
INT32 xdisk_get_total_numpages (THREAD_ENTRY *thread_p, INT16 volid)
 
INT32 xdisk_get_free_numpages (THREAD_ENTRY *thread_p, INT16 volid)
 
bool xdisk_is_volume_exist (THREAD_ENTRY *thread_p, VOLID volid)
 
INT32 disk_get_total_numsectors (THREAD_ENTRY *thread_p, INT16 volid)
 
char * xdisk_get_fullname (THREAD_ENTRY *thread_p, INT16 volid, char *vol_fullname)
 
char * xdisk_get_remarks (THREAD_ENTRY *thread_p, INT16 volid)
 
int disk_get_boot_db_charset (THREAD_ENTRY *thread_p, INT16 volid, INTL_CODESET *db_charset)
 
int disk_dump_all (THREAD_ENTRY *thread_p, FILE *fp)
 
int disk_spacedb (THREAD_ENTRY *thread_p, SPACEDB_ALL *spaceall, SPACEDB_ONEVOL **spacevols)
 
int disk_compare_vsids (const void *first, const void *second)
 
DISK_ISVALID disk_check (THREAD_ENTRY *thread_p, bool repair)
 
void disk_volheader_check_magic (THREAD_ENTRY *thread_p, const PAGE_PTR page_volheader)
 
int disk_sectors_to_extend_npages (const int num_pages)
 

Variables

static DISK_CACHEdisk_Cache = NULL
 
static DKNSECTS disk_Temp_max_sects = -2
 
static bool disk_Logging = false
 
static cubthread::daemondisk_Auto_volume_expansion_daemon = NULL
 

Macro Definition Documentation

#define DISK_ALLOCTBL_SECTOR_BIT_OFFSET (   sect)    (((sect) % DISK_STAB_PAGE_BIT_COUNT) % DISK_STAB_UNIT_BIT_COUNT)

Definition at line 254 of file disk_manager.c.

Referenced by disk_stab_cursor_set_at_sectid().

#define DISK_ALLOCTBL_SECTOR_PAGE_OFFSET (   sect)    ((sect) / DISK_STAB_PAGE_BIT_COUNT)

Definition at line 250 of file disk_manager.c.

Referenced by disk_stab_cursor_set_at_sectid().

#define DISK_ALLOCTBL_SECTOR_UNIT_OFFSET (   sect)    (((sect) % DISK_STAB_PAGE_BIT_COUNT) / DISK_STAB_UNIT_BIT_COUNT)

Definition at line 252 of file disk_manager.c.

Referenced by disk_stab_cursor_set_at_sectid().

#define DISK_MIN_VOLUME_SECTS   DISK_STAB_UNIT_BIT_COUNT

Definition at line 297 of file disk_manager.c.

Referenced by disk_extend().

#define DISK_PRERESERVE_BUF_DEFAULT   16

Definition at line 275 of file disk_manager.c.

#define DISK_RESERVE_CONTEXT_AS_ARGS (   context)
Value:
(context)->nsect_total, (context)->n_cache_vol_reserve, (context)->n_cache_reserve_remaining, \
disk_purpose_to_string ((context)->purpose)
static const char * disk_purpose_to_string(DISK_VOLPURPOSE purpose)

Definition at line 339 of file disk_manager.c.

Referenced by disk_reserve_from_cache_volume(), and disk_unreserve_ordered_sectors_without_csect().

#define DISK_RESERVE_CONTEXT_MSG
Value:
"\t\tcontext: \n" \
"\t\t\tnsect_total = %d\n" \
"\t\t\tn_cache_vol_reserve = %d, n_cache_reserve_remaining = %d\n" \
"\t\t\tpurpose = %s"

Definition at line 334 of file disk_manager.c.

Referenced by disk_reserve_from_cache_volume(), and disk_unreserve_ordered_sectors_without_csect().

#define DISK_SAFE_OSDISK_FREE_SECTS   (DISK_SAFE_OSDISK_FREE_SPACE / IO_SECTORSIZE)

Definition at line 301 of file disk_manager.c.

#define DISK_SAFE_OSDISK_FREE_SPACE   (64 * 1024 * 1024)

Definition at line 300 of file disk_manager.c.

#define DISK_SECTS_ASSERT_ROUNDED (   nsects)    assert (nsects == DISK_SECTS_ROUND_DOWN (nsects))
#define DISK_SECTS_ROUND_DOWN (   nsects)    ((nsects / DISK_STAB_UNIT_BIT_COUNT) * DISK_STAB_UNIT_BIT_COUNT)
#define DISK_SECTS_ROUND_UP (   nsects)    (CEIL_PTVDIV (nsects, DISK_STAB_UNIT_BIT_COUNT) * DISK_STAB_UNIT_BIT_COUNT)
#define DISK_STAB_CURSOR_INITIALIZER   { NULL, 0, 0, 0, 0, NULL, NULL }

Definition at line 239 of file disk_manager.c.

Referenced by disk_reserve_sectors_in_volume().

#define DISK_STAB_NPAGES (   nsect_max)    (CEIL_PTVDIV (nsect_max, DISK_STAB_PAGE_BIT_COUNT))

Definition at line 260 of file disk_manager.c.

#define DISK_STAB_PAGE_UNITS_COUNT   ((int) (DB_PAGESIZE / DISK_STAB_UNIT_SIZE_OF))
#define DISK_STAB_UNIT_SIZE_OF   sizeof (DISK_STAB_UNIT)

Definition at line 222 of file disk_manager.c.

Referenced by disk_check(), and disk_stab_cursor_check_valid().

#define DISK_SYS_NPAGE_SIZE (   nsect_max)    (1 + DISK_STAB_NPAGES (nsect_max))

Definition at line 343 of file disk_manager.c.

#define DISK_SYS_NSECT_SIZE (   nsect_max)    (CEIL_PTVDIV (DISK_SYS_NPAGE_SIZE (nsect_max), DISK_SECTOR_NPAGES))

Definition at line 344 of file disk_manager.c.

Referenced by disk_extend().

#define DISK_VOLHEADER_AS_ARGS (   arg_volh)
Value:
(arg_volh)->volid, \
disk_type_to_string ((arg_volh)->type), \
disk_purpose_to_string ((arg_volh)->purpose), \
(arg_volh)->nsect_total, (arg_volh)->nsect_max, \
(arg_volh)->hint_allocsect, \
(arg_volh)->stab_first_page, (arg_volh)->stab_npages, \
LSA_AS_ARGS (&(arg_volh)->chkpt_lsa), \
(arg_volh)->next_volid
#define LSA_AS_ARGS(lsa_ptr)
Definition: log_lsa.hpp:78
static const char * disk_purpose_to_string(DISK_VOLPURPOSE purpose)
static const char * disk_type_to_string(DB_VOLTYPE voltype)

Definition at line 324 of file disk_manager.c.

Referenced by disk_volume_expand().

#define DISK_VOLHEADER_MSG
Value:
"\t\tvolume header: \n" \
"\t\t\tvolid = %d\n" \
"\t\t\ttype = %s\n" \
"\t\t\tpurpose = %s\n" \
"\t\t\tsectors: total = %d, max = %d\n" \
"\t\t\thint_allocset = %d\n" \
"\t\t\tsector allocation table: start = %d, num pages = %d\n" \
"\t\t\tchkpt_lsa = %lld|%d\n" \
"\t\t\tnext_volid = %d\n"

Definition at line 314 of file disk_manager.c.

Referenced by disk_volume_expand().

#define fault_inject_random_crash ( )    if (vol_purpose == DB_PERMANENT_DATA_PURPOSE) FI_TEST (thread_p, FI_TEST_DISK_MANAGER_VOLUME_ADD, 0)

Referenced by disk_format().

Typedef Documentation

typedef struct disk_cache DISK_CACHE

Definition at line 190 of file disk_manager.c.

Definition at line 269 of file disk_manager.c.

Definition at line 151 of file disk_manager.c.

Definition at line 140 of file disk_manager.c.

Definition at line 158 of file disk_manager.c.

Definition at line 176 of file disk_manager.c.

Definition at line 117 of file disk_manager.c.

Definition at line 110 of file disk_manager.c.

Definition at line 277 of file disk_manager.c.

Definition at line 225 of file disk_manager.c.

typedef UINT64 DISK_STAB_UNIT

Definition at line 221 of file disk_manager.c.

typedef int(* DISK_STAB_UNIT_FUNC) (THREAD_ENTRY *thread_p, DISK_STAB_CURSOR *cursor, bool *stop, void *args)

Definition at line 263 of file disk_manager.c.

Definition at line 182 of file disk_manager.c.

Definition at line 134 of file disk_manager.c.

Definition at line 72 of file disk_manager.c.

Function Documentation

static int disk_add_volume ( THREAD_ENTRY thread_p,
DBDEF_VOL_EXT_INFO extinfo,
VOLID volid_out,
DKNSECTS nsects_free_out 
)
static
static void disk_auto_volume_expansion_daemon_destroy ( )
static

Referenced by disk_manager_final(), and disk_volume_boot().

Here is the caller graph for this function:

static void disk_auto_volume_expansion_daemon_init ( )
static

Referenced by disk_manager_init(), and disk_volume_boot().

Here is the caller graph for this function:

static bool disk_cache_load_all_volumes ( THREAD_ENTRY thread_p)
static

Definition at line 2681 of file disk_manager.c.

References assert, disk_cache_load_volume(), fileio_map_mounted(), NULL, and STATIC_INLINE.

Referenced by disk_manager_init().

Here is the caller graph for this function:

STATIC_INLINE void disk_cache_lock_reserve ( DISK_EXTEND_INFO expand_info)
STATIC_INLINE void disk_cache_unlock_reserve ( DISK_EXTEND_INFO expand_info)
static int disk_can_overwrite_data_volume ( THREAD_ENTRY thread_p,
const char *  vol_label_p,
bool can_overwrite 
)
static
DISK_ISVALID disk_check ( THREAD_ENTRY thread_p,
bool  repair 
)

Definition at line 6348 of file disk_manager.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, assert_release, bit64_clear(), bit64_is_set(), bit64_set_trailing_bits(), CSECT_DISK_CHECK, csect_enter, csect_exit, DB_PAGESIZE, DB_PERMANENT_DATA_PURPOSE, DB_TEMPORARY_DATA_PURPOSE, disk_check_volume(), DISK_ERROR, disk_get_volheader, DISK_INVALID, disk_log, DISK_STAB_PAGE_BIT_COUNT, DISK_STAB_UNIT_BIT_COUNT, DISK_STAB_UNIT_SIZE_OF, DISK_VALID, ER_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), disk_perm_info::extend_info, disk_temp_info::extend_info, free_and_init, INF_WAIT, LOG_MAX_DBVOLID, disk_volmap_clone::map, NO_ERROR, disk_cache_volinfo::nsect_free, disk_extend_info::nsect_free, disk_temp_info::nsect_perm_free, disk_volume_header::nsect_total, NULL, disk_cache::nvols_perm, disk_cache::nvols_temp, OLD_PAGE, vpid::pageid, disk_cache::perm_purpose_info, pgbuf_fix, PGBUF_LATCH_READ, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix, pgbuf_unfix_and_init, disk_cache_volinfo::purpose, vsid::sectid, SECTOR_FROM_PAGEID, disk_volmap_clone::size_map, disk_volume_header::stab_first_page, disk_volume_header::stab_npages, disk_volume_header::sys_lastpage, disk_cache::temp_purpose_info, disk_volume_header::volid, vpid::volid, vsid::volid, disk_cache::vols, xboot_find_last_permanent(), xboot_find_last_temp(), xboot_find_number_permanent_volumes(), and xboot_find_number_temp_volumes().

Referenced by disk_reserve_sectors(), and xboot_check_db_consistency().

Here is the caller graph for this function:

static bool disk_check_volume_exist ( THREAD_ENTRY thread_p,
VOLID  volid,
void *  arg 
)
static

Definition at line 6100 of file disk_manager.c.

References disk_check_vol_info::exists, and disk_check_vol_info::volid.

Referenced by xdisk_is_volume_exist().

Here is the caller graph for this function:

STATIC_INLINE bool disk_compatible_type_and_purpose ( DB_VOLTYPE  type,
DB_VOLPURPOSE  purpose 
)

Definition at line 6214 of file disk_manager.c.

References DB_PERMANENT_VOLTYPE, and DB_TEMPORARY_DATA_PURPOSE.

Referenced by disk_reserve_from_cache_vols().

Here is the caller graph for this function:

int disk_dump_all ( THREAD_ENTRY thread_p,
FILE *  fp 
)

Definition at line 5853 of file disk_manager.c.

References disk_dump_goodvol_all(), ER_FAILED, fileio_map_mounted(), NO_ERROR, and NULL.

Referenced by diagdb().

Here is the caller graph for this function:

static bool disk_dump_goodvol_all ( THREAD_ENTRY thread_p,
INT16  volid,
void *  ignore 
)
static

Definition at line 5869 of file disk_manager.c.

References disk_dump_volume_system_info(), and STATIC_INLINE.

Referenced by disk_dump_all().

Here is the caller graph for this function:

static int disk_dump_volume_system_info ( THREAD_ENTRY thread_p,
FILE *  fp,
INT16  volid 
)
static

Definition at line 5820 of file disk_manager.c.

References ASSERT_ERROR, disk_get_volheader, disk_stab_dump(), disk_vhdr_dump(), NO_ERROR, NULL, PGBUF_LATCH_READ, and pgbuf_unfix_and_init.

Referenced by disk_dump_goodvol_all().

Here is the caller graph for this function:

static int disk_extend ( THREAD_ENTRY thread_p,
DISK_EXTEND_INFO expand_info,
DISK_RESERVE_CONTEXT reserve_context 
)
static

Definition at line 1618 of file disk_manager.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, dbdef_vol_ext_info::comments, DB_PERMANENT_DATA_PURPOSE, DB_PERMANENT_VOLTYPE, DB_TEMPORARY_DATA_PURPOSE, DB_TEMPORARY_VOLTYPE, disk_add_volume(), disk_cache_lock_reserve(), disk_cache_unlock_reserve(), disk_cache_update_vol_free(), disk_is_valid_volid(), disk_log, DISK_MIN_VOLUME_SECTS, disk_reserve_from_cache_volume(), DISK_SECTS_ROUND_UP, DISK_SYS_NSECT_SIZE, disk_type_to_string(), disk_volume_expand(), ER_ERROR_SEVERITY, ER_INTERRUPTED, er_set(), LOG_MAX_DBVOLID, log_sysop_abort(), log_sysop_commit(), log_sysop_start(), logtb_get_check_interrupt(), logtb_is_interrupted(), logtb_set_check_interrupt(), max, dbdef_vol_ext_info::max_writesize_in_sec, disk_reserve_context::n_cache_reserve_remaining, dbdef_vol_ext_info::name, NO_ERROR, disk_cache_volinfo::nsect_free, disk_extend_info::nsect_free, disk_extend_info::nsect_intention, disk_extend_info::nsect_max, dbdef_vol_ext_info::nsect_max, disk_extend_info::nsect_total, dbdef_vol_ext_info::nsect_total, disk_extend_info::nsect_vol_max, NULL, NULL_VOLID, disk_cache::nvols_perm, disk_cache::nvols_temp, dbdef_vol_ext_info::overwrite, disk_cache::owner_extend, dbdef_vol_ext_info::path, disk_cache_volinfo::purpose, dbdef_vol_ext_info::purpose, thread_get_entry_index(), tsc_getticks(), disk_extend_info::volid_extend, disk_cache::vols, disk_extend_info::voltype, and dbdef_vol_ext_info::voltype.

Referenced by disk_reserve_from_cache().

Here is the caller graph for this function:

static int disk_format ( THREAD_ENTRY thread_p,
const char *  dbname,
INT16  volid,
DBDEF_VOL_EXT_INFO ext_info,
DKNSECTS nsect_free_out 
)
static

Definition at line 510 of file disk_manager.c.

References ARG_FILE_LINE, assert, ASSERT_ERROR, ASSERT_ERROR_AND_SET, disk_volume_header::boot_hfid, disk_volume_header::chkpt_lsa, dbdef_vol_ext_info::comments, CUBRID_MAGIC_DATABASE_VOLUME, CUBRID_MAGIC_MAX_LENGTH, disk_volume_header::db_charset, disk_volume_header::db_creation, DB_MAX_PATH_LENGTH, DB_PAGESIZE, DB_PERMANENT_DATA_PURPOSE, DB_PERMANENT_VOLTYPE, DB_TEMPORARY_DATA_PURPOSE, DB_TEMPORARY_VOLTYPE, DISK_FLUSH, DISK_SECTOR_NPAGES, DISK_SECTS_NPAGES, disk_set_link(), disk_stab_init(), disk_unformat(), disk_verify_volume_header(), disk_vhdr_length_of_varfields(), disk_vhdr_set_next_vol_fullname(), disk_vhdr_set_vol_fullname(), disk_vhdr_set_vol_remarks(), DISK_VOLHEADER_PAGE, DISK_VOLPURPOSE, disk_volume_header_set_stab(), disk_volume_header::dummy1, disk_volume_header::dummy2, dwb_flush_force(), ER_BO_FULL_DATABASE_NAME_IS_TOO_LONG, ER_DISK_UNKNOWN_PURPOSE, ER_ERROR_SEVERITY, ER_FATAL_ERROR_SEVERITY, ER_IO_FORMAT_BAD_NPAGES, er_set(), fault_inject_random_crash, vfid::fileid, fileio_find_previous_perm_volume(), fileio_format(), fileio_reset_volume(), FILEIO_SYNC_ALSO_FLUSH_DWB, fileio_synchronize(), disk_volume_header::hint_allocsect, hfid::hpgid, IO_PAGESIZE, disk_volume_header::iopagesize, lang_charset(), log_append_dboutside_redo(), log_append_redo_data(), log_append_undo_data(), LOG_DBFIRST_VOLID, log_get_db_start_parameters(), logpb_force_flush_pages(), disk_volume_header::magic, dbdef_vol_ext_info::max_writesize_in_sec, dbdef_vol_ext_info::name, NEW_PAGE, disk_volume_header::next_volid, NO_ERROR, disk_volume_header::nsect_max, dbdef_vol_ext_info::nsect_max, disk_volume_header::nsect_total, dbdef_vol_ext_info::nsect_total, NULL, NULL_PAGEID, NULL_SECTID, NULL_VOLDES, NULL_VOLID, log_data_addr::offset, disk_volume_header::offset_to_next_vol_fullname, disk_volume_header::offset_to_vol_fullname, disk_volume_header::offset_to_vol_remarks, OLD_PAGE, PAGE_VOLHEADER, vpid::pageid, pgbuf_fix, pgbuf_flush_all(), pgbuf_invalidate_all, PGBUF_LATCH_WRITE, pgbuf_set_dirty_and_free, pgbuf_set_lsa_as_temporary(), pgbuf_set_page_ptype(), PGBUF_TEMP_LSA, PGBUF_UNCONDITIONAL_LATCH, pgbuf_unfix, pgbuf_unfix_and_init, log_data_addr::pgptr, disk_volume_header::purpose, dbdef_vol_ext_info::purpose, disk_volume_header::reserved0, disk_volume_header::reserved1, disk_volume_header::reserved2, disk_volume_header::reserved3, RVDK_FORMAT, RVDK_NEWVOL, disk_volume_header::sect_npgs, SECTOR_FROM_PAGEID, strlen, disk_volume_header::sys_lastpage, disk_volume_header::type, disk_volume_header::var_fields, log_data_addr::vfid, hfid::vfid, disk_volume_header::volid, vpid::volid, vfid::volid, and dbdef_vol_ext_info::voltype.

Referenced by disk_add_volume(), and disk_format_first_volume().

Here is the caller graph for this function:

int disk_get_boot_db_charset ( THREAD_ENTRY thread_p,
INT16  volid,
INTL_CODESET db_charset 
)

Definition at line 5788 of file disk_manager.c.

References assert, ASSERT_ERROR, disk_volume_header::db_charset, disk_get_volheader, NO_ERROR, NULL, PGBUF_LATCH_READ, and pgbuf_unfix_and_init.

Referenced by boot_get_db_charset_from_header().

Here is the caller graph for this function:

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_creation_time ( 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 
)
STATIC_INLINE int disk_get_volheader_internal ( THREAD_ENTRY thread_p,
VOLID  volid,
PGBUF_LATCH_MODE  latch_mode,
PAGE_PTR page_volheader_out,
DISK_VOLUME_HEADER **  volheader_out,
const char *  file,
int  line 
)
STATIC_INLINE DB_VOLTYPE disk_get_voltype ( VOLID  volid)

Definition at line 5910 of file disk_manager.c.

References assert, DB_PERMANENT_VOLTYPE, DB_TEMPORARY_VOLTYPE, disk_is_valid_volid(), NULL, and disk_cache::nvols_perm.

Referenced by disk_cache_update_vol_free().

Here is the caller graph for this function:

static DISK_ISVALID disk_is_sector_reserved ( THREAD_ENTRY thread_p,
const DISK_VOLUME_HEADER volheader,
SECTID  sectid,
bool  debug_crash 
)
static
STATIC_INLINE bool disk_is_valid_volid ( VOLID  volid)

Definition at line 5883 of file disk_manager.c.

References LOG_MAX_DBVOLID, disk_cache::nvols_perm, disk_cache::nvols_temp, and STATIC_INLINE.

Referenced by disk_add_volume_extension(), disk_extend(), disk_get_volpurpose(), disk_get_voltype(), and xdisk_get_purpose().

Here is the caller graph for this function:

void disk_manager_final ( void  )

Definition at line 4980 of file disk_manager.c.

References disk_auto_volume_expansion_daemon_destroy(), and disk_cache_final().

Referenced by boot_server_all_finalize(), and disk_manager_init().

Here is the caller graph for this function:

static const char * disk_purpose_to_string ( DISK_VOLPURPOSE  purpose)
static

Definition at line 5213 of file disk_manager.c.

References assert, DB_PERMANENT_DATA_PURPOSE, and DB_TEMPORARY_DATA_PURPOSE.

Referenced by disk_add_volume(), disk_reserve_sectors(), disk_vhdr_dump(), and disk_volume_header_next_scan().

Here is the caller graph for this function:

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

Definition at line 1405 of file disk_manager.c.

References disk_vhdr_dump().

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

Definition at line 1453 of file disk_manager.c.

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 
)

Definition at line 1567 of file disk_manager.c.

References vfid::fileid, hfid::hpgid, hfid::vfid, and vfid::volid.

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_volume_expand ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int disk_rv_undoredo_set_boot_hfid ( THREAD_ENTRY thread_p,
LOG_RCV rcv 
)
int disk_sectors_to_extend_npages ( const int  num_pages)

Definition at line 6744 of file disk_manager.c.

References DISK_PAGES_TO_SECTS, and DISK_SECTS_ROUND_UP.

Referenced by createdb(), disk_add_volume_extension(), and disk_format_first_volume().

Here is the caller graph for this function:

static int disk_stab_count_free ( THREAD_ENTRY thread_p,
DISK_STAB_CURSOR cursor,
bool stop,
void *  args 
)
static

Definition at line 3725 of file disk_manager.c.

References bit64_count_zeros(), NO_ERROR, and disk_stab_cursor::unit.

Referenced by disk_check_volume(), disk_rv_redo_format(), disk_rv_volhead_extend_redo(), and disk_volume_boot().

Here is the caller graph for this function:

STATIC_INLINE int disk_stab_cursor_compare ( const DISK_STAB_CURSOR first_cursor,
const DISK_STAB_CURSOR second_cursor 
)

Definition at line 3292 of file disk_manager.c.

References assert, NULL, disk_stab_cursor::offset_to_bit, disk_stab_cursor::offset_to_unit, disk_stab_cursor::pageid, and STATIC_INLINE.

Referenced by disk_stab_iterate_units().

Here is the caller graph for this function:

STATIC_INLINE SECTID disk_stab_cursor_get_sectid ( const DISK_STAB_CURSOR cursor)

Definition at line 3441 of file disk_manager.c.

References disk_stab_cursor_check_valid(), disk_stab_cursor::sectid, and STATIC_INLINE.

Referenced by disk_stab_unit_reserve().

Here is the caller graph for this function:

STATIC_INLINE void disk_stab_cursor_set_bit ( DISK_STAB_CURSOR cursor)
STATIC_INLINE void disk_stab_cursor_unfix ( THREAD_ENTRY thread_p,
DISK_STAB_CURSOR cursor 
)

Definition at line 3489 of file disk_manager.c.

References NULL, disk_stab_cursor::page, pgbuf_unfix_and_init, and disk_stab_cursor::unit.

Referenced by disk_is_sector_reserved(), and disk_stab_iterate_units().

Here is the caller graph for this function:

static int disk_stab_dump ( THREAD_ENTRY thread_p,
FILE *  fp,
const DISK_VOLUME_HEADER volheader 
)
static

Definition at line 3805 of file disk_manager.c.

References ASSERT_ERROR, disk_stab_dump_unit(), disk_stab_iterate_units_all(), NO_ERROR, and PGBUF_LATCH_READ.

Referenced by disk_dump_volume_system_info().

Here is the caller graph for this function:

static int disk_stab_dump_unit ( THREAD_ENTRY thread_p,
DISK_STAB_CURSOR cursor,
bool stop,
void *  args 
)
static

Definition at line 3773 of file disk_manager.c.

References disk_stab_cursor_is_bit_set(), DISK_STAB_UNIT_BIT_COUNT, NO_ERROR, and disk_stab_cursor::sectid.

Referenced by disk_stab_dump().

Here is the caller graph for this function:

static int disk_stab_iterate_units_all ( THREAD_ENTRY thread_p,
const DISK_VOLUME_HEADER volheader,
PGBUF_LATCH_MODE  mode,
DISK_STAB_UNIT_FUNC  f_unit,
void *  f_unit_args 
)
static

Definition at line 3704 of file disk_manager.c.

References disk_stab_cursor_set_at_end(), disk_stab_cursor_set_at_start(), and disk_stab_iterate_units().

Referenced by disk_check_volume(), disk_rv_redo_format(), disk_stab_dump(), and disk_volume_boot().

Here is the caller graph for this function:

static int disk_stab_set_bits_contiguous ( THREAD_ENTRY thread_p,
DISK_STAB_CURSOR cursor,
bool stop,
void *  args 
)
static

Definition at line 3744 of file disk_manager.c.

References BIT64_FULL, bit64_set_trailing_bits(), DISK_STAB_UNIT_BIT_COUNT, NO_ERROR, and disk_stab_cursor::unit.

Referenced by disk_stab_init().

Here is the caller graph for this function:

static int disk_stab_unit_check_reserved ( THREAD_ENTRY thread_p,
DISK_STAB_CURSOR cursor,
bool stop,
void *  args 
)
static
static const char * disk_type_to_string ( DB_VOLTYPE  voltype)
static

Definition at line 5235 of file disk_manager.c.

References DB_PERMANENT_VOLTYPE.

Referenced by disk_add_volume(), disk_extend(), disk_reserve_from_cache(), disk_vhdr_dump(), and disk_volume_header_next_scan().

Here is the caller graph for this function:

int disk_unformat ( THREAD_ENTRY thread_p,
const char *  vol_fullname 
)
int disk_unreserve_ordered_sectors ( THREAD_ENTRY thread_p,
DB_VOLPURPOSE  purpose,
int  nsects,
VSID vsids 
)

Definition at line 4634 of file disk_manager.c.

References ASSERT_ERROR, CSECT_DISK_CHECK, csect_enter_as_reader, csect_exit, disk_unreserve_ordered_sectors_without_csect(), INF_WAIT, and NO_ERROR.

Referenced by file_create(), and file_destroy().

Here is the caller graph for this function:

STATIC_INLINE char * disk_vhdr_get_next_vol_fullname ( const DISK_VOLUME_HEADER vhdr)
STATIC_INLINE int disk_vhdr_length_of_varfields ( const DISK_VOLUME_HEADER vhdr)

Definition at line 5401 of file disk_manager.c.

References disk_vhdr_get_vol_remarks(), disk_volume_header::offset_to_vol_remarks, and strlen.

Referenced by disk_format().

Here is the caller graph for this function:

static int disk_vhdr_set_next_vol_fullname ( DISK_VOLUME_HEADER vhdr,
const char *  next_vol_fullname 
)
static
static int disk_vhdr_set_vol_remarks ( DISK_VOLUME_HEADER vhdr,
const char *  vol_remarks 
)
static

Definition at line 5330 of file disk_manager.c.

References DB_PAGESIZE, disk_vhdr_get_vol_remarks(), NO_ERROR, NULL, disk_volume_header::offset_to_vol_remarks, STATIC_INLINE, strlen, and disk_volume_header::var_fields.

Referenced by disk_format().

Here is the caller graph for this function:

void disk_volheader_check_magic ( THREAD_ENTRY thread_p,
const PAGE_PTR  page_volheader 
)

Definition at line 6726 of file disk_manager.c.

References assert, CUBRID_MAGIC_DATABASE_VOLUME, CUBRID_MAGIC_MAX_LENGTH, disk_volume_header::magic, PAGE_VOLHEADER, and pgbuf_check_page_ptype().

Referenced by pgbuf_set_dirty().

Here is the caller graph for this function:

int disk_volume_header_end_scan ( THREAD_ENTRY thread_p,
void **  ptr 
)

Definition at line 3080 of file disk_manager.c.

References db_private_free_and_init, and NO_ERROR.

Referenced by showstmt_scan_init().

Here is the caller graph for this function:

STATIC_INLINE void disk_volume_header_set_stab ( DB_VOLPURPOSE  vol_purpose,
DISK_VOLUME_HEADER volheader 
)
int disk_volume_header_start_scan ( THREAD_ENTRY thread_p,
int  type,
DB_VALUE **  arg_values,
int  arg_cnt,
void **  ptr 
)
INT32 xdisk_get_free_numpages ( THREAD_ENTRY thread_p,
INT16  volid 
)

Definition at line 5659 of file disk_manager.c.

References assert, DISK_SECTS_NPAGES, LOG_MAX_DBVOLID, disk_cache_volinfo::nsect_free, NULL, disk_cache::nvols_temp, and disk_cache::vols.

Referenced by disk_get_free_numpages(), and sdk_freepgs().

Here is the caller graph for this function:

char* xdisk_get_fullname ( THREAD_ENTRY thread_p,
INT16  volid,
char *  vol_fullname 
)
DISK_VOLPURPOSE xdisk_get_purpose ( THREAD_ENTRY thread_p,
INT16  volid 
)
INT16 xdisk_get_purpose_and_sys_lastpage ( THREAD_ENTRY thread_p,
INT16  volid,
DISK_VOLPURPOSE vol_purpose,
INT32 *  sys_lastpage 
)
char* xdisk_get_remarks ( THREAD_ENTRY thread_p,
INT16  volid 
)

Definition at line 5758 of file disk_manager.c.

References ASSERT_ERROR, disk_get_volheader, disk_vhdr_get_vol_remarks(), NO_ERROR, NULL, PGBUF_LATCH_READ, pgbuf_unfix_and_init, and strlen.

Referenced by disk_get_remarks(), and sdk_remarks().

Here is the caller graph for this function:

INT32 xdisk_get_total_numpages ( THREAD_ENTRY thread_p,
INT16  volid 
)
bool xdisk_is_volume_exist ( THREAD_ENTRY thread_p,
VOLID  volid 
)

Definition at line 5675 of file disk_manager.c.

References disk_check_volume_exist(), disk_check_vol_info::exists, fileio_map_mounted(), disk_volume_header::volid, and disk_check_vol_info::volid.

Referenced by disk_volume_header_start_scan().

Here is the caller graph for this function:

Variable Documentation

cubthread::daemon* disk_Auto_volume_expansion_daemon = NULL
static

Definition at line 481 of file disk_manager.c.

DISK_CACHE* disk_Cache = NULL
static

Definition at line 206 of file disk_manager.c.

bool disk_Logging = false
static

Definition at line 308 of file disk_manager.c.

Referenced by disk_manager_init().

DKNSECTS disk_Temp_max_sects = -2
static

Definition at line 208 of file disk_manager.c.

Referenced by disk_manager_init(), and disk_reserve_from_cache().