CUBRID Engine  latest
file_io.h File Reference
#include "config.h"
#include "dbtype_def.h"
#include "log_lsa.hpp"
#include "lz4.h"
#include "memory_hash.h"
#include "porting.h"
#include "porting_inline.hpp"
#include "release_string.h"
#include "storage_common.h"
#include "thread_compat.hpp"
#include <stdio.h>
#include <time.h>
Include dependency graph for file_io.h:

Go to the source code of this file.

Classes

struct  fileio_page_reserved
 
struct  fileio_page_watermark
 
struct  fileio_page
 
struct  fileio_backup_page
 
struct  page_bitmap
 
struct  page_bitmap_list
 
struct  fileio_backup_record_info
 
struct  fileio_backup_header
 
struct  fileio_backup_buffer
 
struct  fileio_backup_db_buffer
 
struct  file_zip_page
 
struct  file_zip_info
 
struct  fileio_node
 
struct  fileio_queue
 
struct  fileio_thread_info
 
struct  io_backup_session
 
struct  token_bucket
 
struct  flush_stats
 

Macros

#define NULL_VOLDES   (-1) /* Value of a null (invalid) vol descriptor */
 
#define FILEIO_INITIAL_BACKUP_UNITS   0
 
#define FILEIO_NO_BACKUP_UNITS   -1
 
#define FILEIO_MAX_USER_RESPONSE_SIZE   2000
 
#define FILEIO_FIRST_BACKUP_VOL_INFO   0
 
#define FILEIO_SECOND_BACKUP_VOL_INFO   1
 
#define FILEIO_BACKUP_NUM_THREADS_AUTO   0
 
#define FILEIO_BACKUP_SLEEP_MSECS_AUTO   0
 
#define FILEIO_PAGE_FLAG_ENCRYPTED_AES   0x1
 
#define FILEIO_PAGE_FLAG_ENCRYPTED_ARIA   0x2
 
#define FILEIO_PAGE_FLAG_ENCRYPTED_MASK   0x3
 
#define STR_PATH_SEPARATOR   "/"
 
#define PEEK   true /* Peek volume label pointer */
 
#define ALLOC_COPY   false /* alloc and copy volume label */
 
#define FILEIO_PATH_SEPARATOR(path)   (path[strlen(path) - 1] == PATH_SEPARATOR ? "" : STR_PATH_SEPARATOR)
 
#define FILEIO_SUFFIX_LOGACTIVE   "_lgat"
 
#define FILEIO_SUFFIX_LOGARCHIVE   "_lgar"
 
#define FILEIO_SUFFIX_TMP_LOGARCHIVE   "_lgar_t"
 
#define FILEIO_SUFFIX_LOGINFO   "_lginf"
 
#define FILEIO_SUFFIX_BACKUP   "_bk"
 
#define FILEIO_SUFFIX_BACKUP_VOLINFO   "_bkvinf"
 
#define FILEIO_VOLEXT_PREFIX   "_x"
 
#define FILEIO_VOLTMP_PREFIX   "_t"
 
#define FILEIO_VOLINFO_SUFFIX   "_vinf"
 
#define FILEIO_VOLLOCK_SUFFIX   "__lock"
 
#define FILEIO_SUFFIX_DWB   "_dwb"
 
#define FILEIO_SUFFIX_KEYS   "_keys"
 
#define FILEIO_MAX_SUFFIX_LENGTH   7
 

Typedefs

typedef struct fileio_page_reserved FILEIO_PAGE_RESERVED
 
typedef struct fileio_page_watermark FILEIO_PAGE_WATERMARK
 
typedef struct fileio_page FILEIO_PAGE
 
typedef struct fileio_backup_page FILEIO_BACKUP_PAGE
 
typedef struct page_bitmap FILEIO_RESTORE_PAGE_BITMAP
 
typedef struct page_bitmap_list FILEIO_RESTORE_PAGE_BITMAP_LIST
 
typedef struct fileio_backup_record_info FILEIO_BACKUP_RECORD_INFO
 
typedef struct fileio_backup_header FILEIO_BACKUP_HEADER
 
typedef struct fileio_backup_buffer FILEIO_BACKUP_BUFFER
 
typedef struct fileio_backup_db_buffer FILEIO_BACKUP_DB_BUFFER
 
typedef struct file_zip_page FILEIO_ZIP_PAGE
 
typedef struct file_zip_info FILEIO_ZIP_INFO
 
typedef struct fileio_node FILEIO_NODE
 
typedef struct fileio_queue FILEIO_QUEUE
 
typedef struct fileio_thread_info FILEIO_THREAD_INFO
 
typedef struct io_backup_session FILEIO_BACKUP_SESSION
 
typedef struct token_bucket TOKEN_BUCKET
 
typedef struct flush_stats FLUSH_STATS
 

Enumerations

enum  FILEIO_BACKUP_LEVEL { FILEIO_BACKUP_FULL_LEVEL = 0, FILEIO_BACKUP_BIG_INCREMENT_LEVEL, FILEIO_BACKUP_SMALL_INCREMENT_LEVEL, FILEIO_BACKUP_UNDEFINED_LEVEL }
 
enum  FILEIO_ZIP_METHOD {
  FILEIO_ZIP_NONE_METHOD, FILEIO_ZIP_LZO1X_METHOD, FILEIO_ZIP_ZLIB_METHOD, FILEIO_ZIP_LZ4_METHOD,
  FILEIO_ZIP_UNDEFINED_METHOD
}
 
enum  FILEIO_ZIP_LEVEL { FILEIO_ZIP_NONE_LEVEL, FILEIO_ZIP_1_LEVEL, FILEIO_ZIP_UNDEFINED_LEVEL, FILEIO_ZIP_LZ4_DEFAULT_LEVEL = FILEIO_ZIP_1_LEVEL }
 
enum  FILEIO_BACKUP_VOL_TYPE { FILEIO_BACKUP_VOL_UNKNOWN, FILEIO_BACKUP_VOL_DIRECTORY, FILEIO_BACKUP_VOL_DEVICE }
 
enum  FILEIO_REMOTE_PROMPT_TYPE {
  FILEIO_PROMPT_UNKNOWN, FILEIO_PROMPT_RANGE_TYPE, FILEIO_PROMPT_BOOLEAN_TYPE, FILEIO_PROMPT_STRING_TYPE,
  FILEIO_PROMPT_RANGE_WITH_SECONDARY_STRING_TYPE, FILEIO_PROMPT_DISPLAY_ONLY
}
 
enum  FILEIO_TYPE { FILEIO_ERROR_INTERRUPT, FILEIO_READ, FILEIO_WRITE }
 
enum  FILEIO_BACKUP_TYPE { FILEIO_BACKUP_WRITE, FILEIO_BACKUP_READ }
 
enum  FILEIO_LOCKF_TYPE { FILEIO_LOCKF, FILEIO_RUN_AWAY_LOCKF, FILEIO_NOT_LOCKF }
 
enum  FILEIO_SYNC_OPTION { FILEIO_SYNC_ONLY, FILEIO_SYNC_ALSO_FLUSH_DWB }
 
enum  FILEIO_WRITE_MODE { FILEIO_WRITE_DEFAULT_WRITE, FILEIO_WRITE_NO_COMPENSATE_WRITE }
 

Functions

STATIC_INLINE FILEIO_PAGE_WATERMARKfileio_get_page_watermark_pos (FILEIO_PAGE *io_page, PGLENGTH page_size)
 
STATIC_INLINE void fileio_init_lsa_of_page (FILEIO_PAGE *io_page, PGLENGTH page_size)
 
STATIC_INLINE void fileio_reset_page_lsa (FILEIO_PAGE *io_page, PGLENGTH page_size)
 
STATIC_INLINE void fileio_set_page_lsa (FILEIO_PAGE *io_page, const LOG_LSA *lsa, PGLENGTH page_size)
 
STATIC_INLINE int fileio_is_page_sane (FILEIO_PAGE *io_page, PGLENGTH page_size)
 
int fileio_open (const char *vlabel, int flags, int mode)
 
void fileio_close (int vdes)
 
int fileio_format (THREAD_ENTRY *thread_p, const char *db_fullname, const char *vlabel, VOLID volid, DKNPAGES npages, bool sweep_clean, bool dolock, bool dosync, size_t page_size, int kbytes_to_be_written_per_sec, bool reuse_file)
 
int fileio_expand_to (THREAD_ENTRY *threda_p, VOLID volid, DKNPAGES npages_toadd, DB_VOLTYPE voltype)
 
void * fileio_initialize_pages (THREAD_ENTRY *thread_p, int vdes, FILEIO_PAGE *io_pgptr, DKNPAGES start_pageid, DKNPAGES npages, size_t page_size, int kbytes_to_be_written_per_sec)
 
void fileio_initialize_res (THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page, PGLENGTH page_size)
 
void fileio_unformat (THREAD_ENTRY *thread_p, const char *vlabel)
 
void fileio_unformat_and_rename (THREAD_ENTRY *thread_p, const char *vlabel, const char *new_vlabel)
 
int fileio_copy_volume (THREAD_ENTRY *thread_p, int from_vdes, DKNPAGES npages, const char *to_vlabel, VOLID to_volid, bool reset_recvinfo)
 
int fileio_reset_volume (THREAD_ENTRY *thread_p, int vdes, const char *vlabel, DKNPAGES npages, const LOG_LSA *reset_lsa)
 
int fileio_mount (THREAD_ENTRY *thread_p, const char *db_fullname, const char *vlabel, VOLID volid, int lockwait, bool dosync)
 
void fileio_dismount (THREAD_ENTRY *thread_p, int vdes)
 
void fileio_dismount_without_fsync (THREAD_ENTRY *thread_p, int vdes)
 
void fileio_dismount_all (THREAD_ENTRY *thread_p)
 
void * fileio_read (THREAD_ENTRY *thread_p, int vol_fd, void *io_page_p, PAGEID page_id, size_t page_size)
 
void * fileio_write_or_add_to_dwb (THREAD_ENTRY *thread_p, int vol_fd, FILEIO_PAGE *io_page_p, PAGEID page_id, size_t page_size)
 
void * fileio_write (THREAD_ENTRY *thread_p, int vol_fd, void *io_page_p, PAGEID page_id, size_t page_size, FILEIO_WRITE_MODE write_mode)
 
void * fileio_read_pages (THREAD_ENTRY *thread_p, int vol_fd, char *io_pages_p, PAGEID page_id, int num_pages, size_t page_size)
 
void * fileio_write_pages (THREAD_ENTRY *thread_p, int vol_fd, char *io_pages_p, PAGEID page_id, int num_pages, size_t page_size, FILEIO_WRITE_MODE write_mode)
 
void * fileio_writev (THREAD_ENTRY *thread_p, int vdes, void **arrayof_io_pgptr, PAGEID start_pageid, DKNPAGES npages, size_t page_size)
 
int fileio_synchronize (THREAD_ENTRY *thread_p, int vdes, const char *vlabel, FILEIO_SYNC_OPTION check_sync_dwb)
 
int fileio_synchronize_all (THREAD_ENTRY *thread_p, bool include_log)
 
bool fileio_is_volume_exist_and_file (const char *vlabel)
 
DKNPAGES fileio_get_number_of_volume_pages (int vdes, size_t page_size)
 
char * fileio_get_volume_label (VOLID volid, bool is_peek)
 
char * fileio_get_volume_label_by_fd (int vol_fd, bool is_peek)
 
VOLID fileio_find_volume_id_with_label (THREAD_ENTRY *thread_p, const char *vlabel)
 
bool fileio_is_temp_volume (THREAD_ENTRY *thread_p, VOLID volid)
 
bool fileio_is_permanent_volume_descriptor (THREAD_ENTRY *thread_p, int vol_fd)
 
VOLID fileio_find_next_perm_volume (THREAD_ENTRY *thread_p, VOLID volid)
 
VOLID fileio_find_previous_perm_volume (THREAD_ENTRY *thread_p, VOLID volid)
 
VOLID fileio_find_previous_temp_volume (THREAD_ENTRY *thread_p, VOLID volid)
 
int fileio_get_volume_descriptor (VOLID volid)
 
bool fileio_map_mounted (THREAD_ENTRY *thread_p, bool(*fun)(THREAD_ENTRY *thread_p, VOLID volid, void *args), void *args)
 
int fileio_get_number_of_partition_free_pages (const char *path, size_t page_size)
 
DKNSECTS fileio_get_number_of_partition_free_sectors (const char *path_p)
 
const char * fileio_rename (VOLID volid, const char *old_vlabel, const char *new_vlabel)
 
bool fileio_is_volume_exist (const char *vlabel)
 
int fileio_find_volume_descriptor_with_label (const char *vol_label_p)
 
int fileio_get_max_name (const char *path, long int *filename_max, long int *pathname_max)
 
const char * fileio_get_base_file_name (const char *fullname)
 
char * fileio_get_directory_path (char *path, const char *fullname)
 
int fileio_get_volume_max_suffix (void)
 
void fileio_make_volume_info_name (char *volinfo_name, const char *db_fullname)
 
void fileio_make_volume_ext_name (char *volext_fullname, const char *ext_path, const char *ext_name, VOLID volid)
 
void fileio_make_volume_ext_given_name (char *volext_fullname, const char *ext_path, const char *ext_name)
 
void fileio_make_volume_temp_name (char *voltmp_fullname, const char *tmp_path, const char *tmp_name, VOLID volid)
 
void fileio_make_log_active_name (char *logactive_name, const char *log_path, const char *dbname)
 
void fileio_make_temp_log_files_from_backup (char *temp_log_name, VOLID volid, FILEIO_BACKUP_LEVEL level, const char *base_log_name)
 
void fileio_make_log_archive_name (char *logarchive_name, const char *log_path, const char *dbname, int arvnum)
 
void fileio_make_removed_log_archive_name (char *logarchive_name, const char *log_path, const char *dbname)
 
void fileio_make_log_archive_temp_name (char *log_archive_temp_name_p, const char *log_path_p, const char *db_name_p)
 
void fileio_make_log_info_name (char *loginfo_name, const char *log_path, const char *dbname)
 
void fileio_make_backup_volume_info_name (char *backup_volinfo_name, const char *backinfo_path, const char *dbname)
 
void fileio_make_backup_name (char *backup_name, const char *nopath_volname, const char *backup_path, FILEIO_BACKUP_LEVEL level, int unit_num)
 
void fileio_make_dwb_name (char *dwb_name_p, const char *dwb_path_p, const char *db_name_p)
 
void fileio_make_keys_name (char *keys_name_p, const char *db_name_p)
 
void fileio_make_keys_name_given_path (char *keys_name_p, const char *keys_path_p, const char *db_name_p)
 
void fileio_remove_all_backup (THREAD_ENTRY *thread_p, int level)
 
FILEIO_BACKUP_SESSIONfileio_initialize_backup (const char *db_fullname, const char *backup_destination, FILEIO_BACKUP_SESSION *session, FILEIO_BACKUP_LEVEL level, const char *verbose_file_path, int num_threads, int sleep_msecs)
 
FILEIO_BACKUP_SESSIONfileio_start_backup (THREAD_ENTRY *thread_p, const char *db_fullname, INT64 *db_creation, FILEIO_BACKUP_LEVEL backup_level, LOG_LSA *backup_start_lsa, LOG_LSA *backup_ckpt_lsa, FILEIO_BACKUP_RECORD_INFO *all_levels_info, FILEIO_BACKUP_SESSION *session, FILEIO_ZIP_METHOD zip_method, FILEIO_ZIP_LEVEL zip_level)
 
FILEIO_BACKUP_SESSIONfileio_finish_backup (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session)
 
void fileio_abort_backup (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session, bool does_unformat_bk)
 
int fileio_backup_volume (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session, const char *from_vlabel, VOLID from_volid, PAGEID last_page, bool only_updated_pages)
 
FILEIO_BACKUP_SESSIONfileio_start_restore (THREAD_ENTRY *thread_p, const char *db_fullname, char *backup_source, INT64 match_dbcreation, PGLENGTH *db_iopagesize, float *db_compatibility, FILEIO_BACKUP_SESSION *session, FILEIO_BACKUP_LEVEL level, bool authenticate, INT64 match_bkupcreation, const char *restore_verbose_file_path, bool newvolpath)
 
int fileio_finish_restore (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session)
 
void fileio_abort_restore (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session)
 
int fileio_list_restore (THREAD_ENTRY *thread_p, const char *db_fullname, char *backup_source, FILEIO_BACKUP_LEVEL level, bool newvolpath)
 
int fileio_get_backup_volume (THREAD_ENTRY *thread_p, const char *db_fullname, const char *logpath, const char *user_backuppath, int try_level, char *from_volbackup)
 
int fileio_get_next_restore_file (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session, char *filename, VOLID *volid)
 
int fileio_restore_volume (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session, char *to_vlabel, char *verbose_to_vlabel, char *prev_vlabel, FILEIO_RESTORE_PAGE_BITMAP *page_bitmap, bool remember_pages)
 
int fileio_skip_restore_volume (THREAD_ENTRY *thread_p, FILEIO_BACKUP_SESSION *session)
 
const char * fileio_get_zip_method_string (FILEIO_ZIP_METHOD zip_method)
 
const char * fileio_get_zip_level_string (FILEIO_ZIP_LEVEL zip_level)
 
int fileio_read_backup_info_entries (FILE *fp, int which_bkvinf)
 
int fileio_write_backup_info_entries (FILE *fp, int which_bkvinf)
 
const char * fileio_get_backup_info_volume_name (FILEIO_BACKUP_LEVEL level, int unit_num, int which_bkvinf)
 
int fileio_add_volume_to_backup_info (const char *name, FILEIO_BACKUP_LEVEL level, int unit_num, int which_bkvinf)
 
int fileio_clear_backup_info_level (int level, bool dealloc, int which_bkvinf)
 
void fileio_finalize_backup_info (int which_bkvinf)
 
int fileio_request_user_response (THREAD_ENTRY *thread_p, FILEIO_REMOTE_PROMPT_TYPE prompt_id, const char *prompt, char *response, const char *failure_prompt, int range_low, int range_high, const char *secondary_prompt, int reprompt_value)
 
FILEIO_LOCKF_TYPE fileio_lock_la_log_path (const char *db_fullname, const char *lock_path, int vdes, int *last_deleted_arv_num)
 
FILEIO_LOCKF_TYPE fileio_lock_la_dbname (int *lockf_vdes, char *db_name, char *log_path)
 
FILEIO_LOCKF_TYPE fileio_unlock_la_dbname (int *lockf_vdes, char *db_name, bool clear_owner)
 
int fileio_symlink (const char *src, const char *dest, int overwrite)
 
int fileio_set_permission (const char *vlabel)
 
int fileio_flush_control_initialize (void)
 
void fileio_flush_control_finalize (void)
 
int fileio_flush_control_add_tokens (THREAD_ENTRY *thread_p, INT64 diff_usec, int *token_gen, int *token_consumed)
 
void fileio_page_bitmap_list_init (FILEIO_RESTORE_PAGE_BITMAP_LIST *page_bitmap_list)
 
FILEIO_RESTORE_PAGE_BITMAPfileio_page_bitmap_create (int vol_id, int total_pages)
 
FILEIO_RESTORE_PAGE_BITMAPfileio_page_bitmap_list_find (FILEIO_RESTORE_PAGE_BITMAP_LIST *page_bitmap_list, int vol_id)
 
void fileio_page_bitmap_list_add (FILEIO_RESTORE_PAGE_BITMAP_LIST *page_bitmap_list, FILEIO_RESTORE_PAGE_BITMAP *page_bitmap)
 
void fileio_page_bitmap_list_destroy (FILEIO_RESTORE_PAGE_BITMAP_LIST *page_bitmap_list)
 
int fileio_set_page_checksum (THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page)
 
int fileio_page_check_corruption (THREAD_ENTRY *thread_p, FILEIO_PAGE *io_page, bool *is_page_corrupted)
 
void fileio_page_hexa_dump (const char *data, int length)
 
bool fileio_is_formatted_page (THREAD_ENTRY *thread_p, const char *io_page)
 

Macro Definition Documentation

#define ALLOC_COPY   false /* alloc and copy volume label */

Definition at line 75 of file file_io.h.

#define FILEIO_BACKUP_NUM_THREADS_AUTO   0

Definition at line 59 of file file_io.h.

Referenced by backupdb(), and fileio_initialize_backup_thread().

#define FILEIO_BACKUP_SLEEP_MSECS_AUTO   0

Definition at line 60 of file file_io.h.

Referenced by backupdb().

#define FILEIO_MAX_SUFFIX_LENGTH   7

Definition at line 94 of file file_io.h.

Referenced by fileio_get_volume_max_suffix().

#define FILEIO_NO_BACKUP_UNITS   -1

Definition at line 47 of file file_io.h.

Referenced by logpb_backup(), and logpb_restore().

#define FILEIO_PAGE_FLAG_ENCRYPTED_AES   0x1

Definition at line 63 of file file_io.h.

Referenced by pgbuf_get_tde_algorithm(), and pgbuf_set_tde_algorithm().

#define FILEIO_PAGE_FLAG_ENCRYPTED_ARIA   0x2

Definition at line 64 of file file_io.h.

Referenced by pgbuf_get_tde_algorithm(), and pgbuf_set_tde_algorithm().

#define FILEIO_PAGE_FLAG_ENCRYPTED_MASK   0x3
#define FILEIO_SECOND_BACKUP_VOL_INFO   1

Definition at line 58 of file file_io.h.

Referenced by fileio_read_restore(), and logpb_restore().

#define FILEIO_SUFFIX_BACKUP   "_bk"

Definition at line 86 of file file_io.h.

Referenced by fileio_make_backup_name().

#define FILEIO_SUFFIX_BACKUP_VOLINFO   "_bkvinf"

Definition at line 87 of file file_io.h.

Referenced by fileio_make_backup_volume_info_name().

#define FILEIO_SUFFIX_DWB   "_dwb"

Definition at line 92 of file file_io.h.

Referenced by fileio_make_dwb_name().

#define FILEIO_SUFFIX_KEYS   "_keys"

Definition at line 93 of file file_io.h.

Referenced by fileio_make_keys_name(), and fileio_make_keys_name_given_path().

#define FILEIO_SUFFIX_LOGACTIVE   "_lgat"

Definition at line 82 of file file_io.h.

Referenced by fileio_make_log_active_name().

#define FILEIO_SUFFIX_LOGARCHIVE   "_lgar"
#define FILEIO_SUFFIX_LOGINFO   "_lginf"

Definition at line 85 of file file_io.h.

Referenced by fileio_make_log_info_name().

#define FILEIO_SUFFIX_TMP_LOGARCHIVE   "_lgar_t"

Definition at line 84 of file file_io.h.

Referenced by fileio_make_log_archive_temp_name().

#define FILEIO_VOLEXT_PREFIX   "_x"

Definition at line 88 of file file_io.h.

Referenced by fileio_make_volume_ext_name().

#define FILEIO_VOLINFO_SUFFIX   "_vinf"

Definition at line 90 of file file_io.h.

Referenced by fileio_make_volume_info_name().

#define FILEIO_VOLLOCK_SUFFIX   "__lock"

Definition at line 91 of file file_io.h.

Referenced by fileio_make_volume_lock_name().

#define FILEIO_VOLTMP_PREFIX   "_t"

Definition at line 89 of file file_io.h.

Referenced by fileio_make_volume_temp_name().

#define NULL_VOLDES   (-1) /* Value of a null (invalid) vol descriptor */

Definition at line 44 of file file_io.h.

Referenced by alterdbhost(), boot_mount(), boot_reset_mk_after_restart_from_backup(), boot_restart_server(), disk_can_overwrite_data_volume(), disk_format(), disk_is_page_sector_reserved_with_debug_crash(), disk_rv_redo_dboutside_newvol(), double_write_buffer::double_write_buffer(), dwb_add_volume_to_block_flush_area(), dwb_check_data_page_is_sane(), dwb_create_internal(), dwb_destroy_internal(), dwb_flush_block(), dwb_load_and_recover_pages(), dwb_write_block(), file_header_init(), fileio_abort_backup(), fileio_allocate_and_initialize_volume_info(), fileio_backup_volume(), fileio_cache(), fileio_check_file_exist(), fileio_continue_restore(), fileio_copy_volume(), fileio_create(), fileio_create_backup_volume(), fileio_decache(), fileio_dismount_all(), fileio_dismount_volume(), fileio_expand_to(), fileio_find_next_perm_volume(), fileio_find_previous_perm_volume(), fileio_find_previous_temp_volume(), fileio_find_system_volume(), fileio_find_volume_descriptor_with_label(), fileio_format(), fileio_get_next_backup_volume(), fileio_get_number_of_partition_free_pages(), fileio_get_number_of_partition_free_sectors(), fileio_get_primitive_way_max(), fileio_get_volume_descriptor(), fileio_initialize_backup(), fileio_is_permanent_volume_descriptor(), fileio_is_temp_volume(), fileio_is_volume_descriptor_equal(), fileio_is_volume_exist(), fileio_is_volume_exist_and_file(), fileio_lock_la_dbname(), fileio_map_mounted(), fileio_mount(), fileio_open(), fileio_read_restore(), fileio_rename(), fileio_restore_volume(), fileio_skip_restore_volume(), fileio_start_backup(), fileio_synchronize(), fileio_synchronize_sys_volume(), fileio_synchronize_volume(), fileio_traverse_system_volume(), fileio_unformat_and_rename(), fileio_unlock_la_dbname(), fileio_write_backup_end_time_to_header(), fileio_write_or_add_to_dwb(), la_check_duplicated(), la_find_archive_num(), la_find_last_deleted_arv_num(), la_find_log_pagesize(), la_get_range_of_archive(), la_init(), la_lock_dbname(), la_log_fetch_from_archive(), la_log_record_process(), la_shutdown(), la_unlock_dbname(), la_update_last_deleted_arv_num(), log_create_internal(), log_final(), log_get_num_pages_for_creation(), log_initialize_internal(), log_recovery_notpartof_archives(), log_recovery_notpartof_volumes(), log_recovery_resetlog(), logpb_archive_active_log(), logpb_background_archiving(), logpb_backup(), logpb_checkpoint(), logpb_copy_database(), logpb_copy_volume(), logpb_decache_archive_info(), logpb_delete(), logpb_dismount_log_archive(), logpb_fetch_from_archive(), logpb_fetch_header_from_active_log(), logpb_find_oldest_available_page_id(), logpb_flush_all_append_pages(), logpb_get_guess_archive_num(), logpb_peek_header_of_active_log_from_backup(), logpb_remove_all_in_log_path(), logpb_remove_archive_logs(), logpb_rename_all_volumes_files(), logpb_restore(), logpb_write_toflush_pages_to_archive(), tde(), tde_cipher_initialize(), tde_copy_keys_file(), tde_create_keys_file(), tde_initialize(), xboot_copy(), xboot_delete(), xboot_emergency_patch(), xboot_initialize_server(), xboot_soft_rename(), and xtde_change_mk_without_flock().

#define PEEK   true /* Peek volume label pointer */

Definition at line 74 of file file_io.h.

Referenced by boot_check_permanent_volumes(), boot_remove_temp_volume(), btree_build_nleafs(), btree_change_root_header_delta(), btree_check_page_key(), btree_check_pages(), btree_compress_node(), btree_delete_meta_record(), btree_delete_overflow_key(), btree_dump_curr_key(), btree_dump_page(), btree_dump_page_with_subtree(), btree_find_AR_sampling_leaf(), btree_find_boundary_leaf(), btree_find_key_from_leaf(), btree_find_key_from_nleaf(), btree_find_lower_bound_leaf(), btree_find_min_or_max_key(), btree_find_next_index_record_holding_current(), btree_find_oid_from_ovfl(), btree_find_split_point(), btree_fix_ovfl_oid_page(), btree_get_next_node_info(), btree_get_node_header(), btree_get_overflow_header(), btree_get_perf_btree_page_type(), btree_get_root_header(), btree_get_stats_key(), btree_get_subtree_capacity(), btree_get_unique_statistics(), btree_get_value_from_leaf_slot(), btree_is_slot_visible(), btree_key_delete_remove_object(), btree_key_find_and_lock_unique_of_non_unique(), btree_key_find_and_lock_unique_of_unique(), btree_key_find_unique_version_oid(), btree_key_process_objects(), btree_key_record_check_no_visible(), btree_leaf_is_key_between_min_max(), btree_merge_node(), btree_merge_node_and_advance(), btree_merge_root(), btree_node_common_prefix(), btree_node_header_redo_log(), btree_node_header_undo_log(), btree_node_is_compressed(), btree_node_size_uncompressed(), btree_range_scan_advance_over_filtered_keys(), btree_range_scan_find_fk_any_object(), btree_range_scan_select_visible_oids(), btree_read_record(), btree_repair_prev_link_by_btid(), btree_rv_nodehdr_undoredo_update(), btree_rv_util_save_page_records(), btree_search_leaf_page(), btree_search_nonleaf_page(), btree_set_split_point(), btree_sort_get_next(), btree_split_node(), btree_split_root(), btree_split_test(), btree_verify_leaf_node(), btree_verify_nonleaf_node(), btree_verify_subtree(), catalog_check_class_consistency(), catalog_check_consistency(), catalog_drop_representation_helper(), catalog_dump(), catalog_file_map_find_optimal_page(), catalog_file_map_overflow_count(), catalog_file_map_page_dump(), catalog_get_dir_oid_from_cache(), catalog_get_last_representation_id(), catalog_get_record_from_page(), catalog_get_rep_dir(), catalog_get_representation(), catalog_get_representation_directory(), catalog_get_representation_item(), catcls_compile_catalog_classes(), catcls_get_apply_info_log_record_time(), catcls_get_db_collation(), catcls_get_server_compat_info(), css_make_access_status_exist_user(), disk_check_volume(), ehash_binary_search_bucket(), ehash_check_merge_possible(), ehash_delete(), ehash_distribute_records_into_two_bucket(), ehash_dump_bucket(), ehash_find_first_bit_position(), ehash_insert_to_bucket(), ehash_locate_slot(), ehash_map(), ehash_merge_permanent(), ehash_rv_delete(), ehash_rv_delete_redo(), ehash_search(), ehash_split_bucket(), eval_data_filter(), eval_item_card_sort_list(), eval_some_list_eval(), eval_sub_sort_list_to_multi_set(), eval_sub_sort_list_to_sort_list(), fileio_close(), fileio_dismount(), fileio_dismount_without_fsync(), fileio_expand_to(), fileio_read(), fileio_read_pages(), fileio_synchronize_all(), fileio_write(), fileio_write_backup_header(), fileio_write_pages(), heap_check_all_pages(), heap_chkreloc_next(), heap_class_get_partition_info(), heap_classrepr_dump_all(), heap_classrepr_get_from_record(), heap_copy_chain(), heap_create_internal(), heap_delete_all_page_records(), heap_delete_bigone(), heap_delete_home(), heap_delete_relocation(), heap_dump(), heap_estimate(), heap_get_bigone_content(), heap_get_capacity(), heap_get_chain_ptr(), heap_get_class_info_from_record(), heap_get_class_name_alloc_if_diff(), heap_get_class_oid_from_page(), heap_get_class_subclasses(), heap_get_class_supers(), heap_get_class_tde_algorithm(), heap_get_header_stats_ptr(), heap_get_if_diff_chn(), heap_get_last_page(), heap_get_mvcc_header(), heap_get_num_objects(), heap_get_page_info(), heap_get_partition_attributes(), heap_get_record_data_when_all_ready(), heap_get_record_info(), heap_header_next_scan(), heap_is_object_not_null(), heap_last(), heap_next_internal(), heap_ovf_find_vfid(), heap_page_get_max_mvccid(), heap_page_get_vacuum_status(), heap_page_rv_chain_update(), heap_page_set_vacuum_status_none(), heap_page_update_chain_after_mvcc_op(), heap_prepare_get_context(), heap_reinitialize_page(), heap_reuse(), heap_rv_redo_reuse_page(), heap_rv_redo_reuse_page_reuse_oid(), heap_scanrange_to_following(), heap_scanrange_to_prior(), heap_set_autoincrement_value(), heap_stats_find_best_page(), heap_stats_update_internal(), heap_update_home(), heap_update_set_prev_version(), heap_vpid_next(), heap_vpid_prev(), heap_vpid_remove(), locator_all_reference_lockset(), locator_check_class_names(), locator_check_unique_btree_entries(), locator_guess_sub_classes(), locator_initialize(), locator_lock_and_get_object_with_evaluation(), locator_mvcc_reeval_scan_filters(), locator_repl_prepare_force(), locator_update_force(), lock_demote_class_lock(), log_execute_run_postpone(), log_recreate(), log_rollback_record(), log_rv_undo_record(), logpb_backup(), logpb_backup_for_volume(), logpb_checkpoint(), logpb_copy_volume(), logpb_fetch_from_archive(), logpb_next_where_path(), logpb_rename_all_volumes_files(), pgbuf_fix_debug(), pgbuf_flush_checkpoint(), pgbuf_get_volume_label(), pgbuf_is_valid_page(), pgbuf_is_valid_page_ptr(), pgbuf_set_lsa(), pgbuf_unfix_debug(), pgbuf_unlatch_bcb_upon_unfix(), pgbuf_unlatch_thrd_holder(), process_value(), pwrite_with_injected_fault(), qdata_convert_table_to_set(), qdata_evaluate_connect_by_root(), qdata_evaluate_qprior(), qdata_evaluate_sys_connect_by_path(), qdata_finalize_aggregate_list(), qdata_finalize_analytic_func(), qdata_get_interpolation_function_result(), qdata_get_single_tuple_from_list_id(), qdata_load_agg_hentry_from_list(), qexec_analytic_put_next(), qexec_analytic_update_group_result(), qexec_analytic_value_advance(), qexec_check_for_cycle(), qexec_execute_build_columns(), qexec_execute_build_indexes(), qexec_execute_connect_by(), qexec_execute_delete(), qexec_execute_duplicate_key_update(), qexec_execute_obj_fetch(), qexec_execute_update(), qexec_gby_put_next(), qexec_groupby(), qexec_groupby_index(), qexec_hash_gby_put_next(), qexec_iterate_connect_by_results(), qexec_merge_list(), qexec_recalc_tuples_parent_pos_in_list(), qfile_advance_group(), qfile_advance_single(), qfile_copy_tuple(), qfile_make_sort_key(), qfile_reallocate_tuple(), redistribute_partition_data(), cubload::server_class_installer::register_class_with_attributes(), scan_build_hash_list_scan(), scan_dump_key_into_tuple(), scan_hash_probe_next(), scan_jump_scan_pos(), scan_next_class_attr_scan(), scan_next_hash_list_scan(), scan_next_heap_page_scan(), scan_next_heap_scan(), scan_next_index_key_info_scan(), scan_next_index_lookup_heap(), scan_next_index_node_info_scan(), scan_next_index_scan(), scan_next_list_scan(), scan_prev_scan_local(), serial_load_attribute_info_of_db_serial(), serial_update_cur_val_of_serial(), page_key_boundary::set_value(), sort_exphase_merge(), sort_exphase_merge_elim_dup(), sort_inphase_sort(), sort_spage_get_record(), spage_compact(), spage_get_record_data(), spage_verify_header(), stran_can_end_after_query_execution(), tde_add_mk(), tde_find_first_mk(), vacuum_rv_redo_vacuum_heap_page(), xboot_checkdb_table(), xcatalog_check_rep_dir(), xlocator_does_exist(), xserial_get_current_value_internal(), and xserial_get_next_value_internal().

#define STR_PATH_SEPARATOR   "/"

Definition at line 71 of file file_io.h.

Typedef Documentation

Definition at line 322 of file file_io.h.

Definition at line 346 of file file_io.h.

Definition at line 285 of file file_io.h.

Definition at line 244 of file file_io.h.

Definition at line 276 of file file_io.h.

Definition at line 428 of file file_io.h.

typedef struct fileio_node FILEIO_NODE

Definition at line 377 of file file_io.h.

typedef struct fileio_page FILEIO_PAGE

Definition at line 191 of file file_io.h.

Definition at line 171 of file file_io.h.

Definition at line 184 of file file_io.h.

typedef struct fileio_queue FILEIO_QUEUE

Definition at line 389 of file file_io.h.

Definition at line 260 of file file_io.h.

Definition at line 269 of file file_io.h.

Definition at line 398 of file file_io.h.

Definition at line 370 of file file_io.h.

Definition at line 363 of file file_io.h.

typedef struct flush_stats FLUSH_STATS

Definition at line 449 of file file_io.h.

typedef struct token_bucket TOKEN_BUCKET

Definition at line 439 of file file_io.h.

Enumeration Type Documentation

Enumerator
FILEIO_BACKUP_FULL_LEVEL 
FILEIO_BACKUP_BIG_INCREMENT_LEVEL 
FILEIO_BACKUP_SMALL_INCREMENT_LEVEL 
FILEIO_BACKUP_UNDEFINED_LEVEL 

Definition at line 96 of file file_io.h.

Enumerator
FILEIO_BACKUP_WRITE 
FILEIO_BACKUP_READ 

Definition at line 145 of file file_io.h.

Enumerator
FILEIO_BACKUP_VOL_UNKNOWN 
FILEIO_BACKUP_VOL_DIRECTORY 
FILEIO_BACKUP_VOL_DEVICE 

Definition at line 121 of file file_io.h.

Enumerator
FILEIO_LOCKF 
FILEIO_RUN_AWAY_LOCKF 
FILEIO_NOT_LOCKF 

Definition at line 151 of file file_io.h.

Enumerator
FILEIO_PROMPT_UNKNOWN 
FILEIO_PROMPT_RANGE_TYPE 
FILEIO_PROMPT_BOOLEAN_TYPE 
FILEIO_PROMPT_STRING_TYPE 
FILEIO_PROMPT_RANGE_WITH_SECONDARY_STRING_TYPE 
FILEIO_PROMPT_DISPLAY_ONLY 

Definition at line 128 of file file_io.h.

Enumerator
FILEIO_SYNC_ONLY 
FILEIO_SYNC_ALSO_FLUSH_DWB 

Definition at line 158 of file file_io.h.

Enumerator
FILEIO_ERROR_INTERRUPT 
FILEIO_READ 
FILEIO_WRITE 

Definition at line 138 of file file_io.h.

Enumerator
FILEIO_WRITE_DEFAULT_WRITE 
FILEIO_WRITE_NO_COMPENSATE_WRITE 

Definition at line 164 of file file_io.h.

Enumerator
FILEIO_ZIP_NONE_LEVEL 
FILEIO_ZIP_1_LEVEL 
FILEIO_ZIP_UNDEFINED_LEVEL 
FILEIO_ZIP_LZ4_DEFAULT_LEVEL 

Definition at line 113 of file file_io.h.

Enumerator
FILEIO_ZIP_NONE_METHOD 
FILEIO_ZIP_LZO1X_METHOD 
FILEIO_ZIP_ZLIB_METHOD 
FILEIO_ZIP_LZ4_METHOD 
FILEIO_ZIP_UNDEFINED_METHOD 

Definition at line 104 of file file_io.h.

Function Documentation

void fileio_abort_restore ( THREAD_ENTRY thread_p,
FILEIO_BACKUP_SESSION session 
)

Definition at line 8980 of file file_io.c.

References fileio_abort_backup().

Referenced by fileio_finish_restore(), fileio_list_restore(), and logpb_restore().

Here is the caller graph for this function:

int fileio_add_volume_to_backup_info ( const char *  name,
FILEIO_BACKUP_LEVEL  level,
int  unit_num,
int  which_bkvinf 
)
int fileio_backup_volume ( THREAD_ENTRY thread_p,
FILEIO_BACKUP_SESSION session,
const char *  from_vlabel,
VOLID  from_volid,
PAGEID  last_page,
bool  only_updated_pages 
)

Definition at line 8215 of file file_io.c.

References fileio_thread_info::act_r_threads, fileio_backup_db_buffer::area, fileio_node::area, ARG_FILE_LINE, fileio_backup_header::bkpagesize, io_backup_session::bkup, fileio_backup_buffer::bkuphdr, CEIL_PTVDIV, fileio_thread_info::check_ratio, io_backup_session::dbfile, ER_ERROR_SEVERITY, ER_FAILED, ER_IO_MOUNT_FAIL, ER_IO_READ, er_set_with_oserror(), error(), fileio_allocate_node(), FILEIO_BACKUP_FILE_END_PAGE_ID, FILEIO_BACKUP_FILE_HEADER_PAGE_SIZE, FILEIO_BACKUP_FILE_START_PAGE_ID, FILEIO_BACKUP_PAGE_OVERHEAD, FILEIO_CHECK_FOR_INTERRUPT_INTERVAL, fileio_close(), fileio_compress_backup_node(), FILEIO_DBVOLS_IO_PAGE_SIZE, fileio_free_node(), fileio_get_base_file_name(), fileio_get_volume_descriptor(), fileio_open(), fileio_read_backup(), FILEIO_SET_BACKUP_PAGE_ID, FILEIO_SET_BACKUP_PAGE_ID_COPY, fileio_write_backup(), fileio_write_backup_node(), FILEIO_ZIP_NONE_METHOD, IO_PAGESIZE, fileio_thread_info::io_queue, fileio_backup_page::iopage, fileio_backup_page::iopageid, LOG_DBLOG_ACTIVE_VOLID, fileio_page_reserved::lsa, fileio_backup_db_buffer::lsa, LSA_ISNULL(), LSA_LT(), MSGCAT_CATALOG_CUBRID, MSGCAT_FILEIO_BKUP_FILE, msgcat_message(), MSGCAT_SET_IO, fileio_backup_file_header::nbytes, fileio_backup_db_buffer::nbytes, NO_ERROR, fileio_node::nread, NULL, NULL_VOLDES, NULL_VOLID, fileio_thread_info::num_threads, fileio_node::pageid, pgbuf_is_log_check_for_interrupts(), fileio_page::prv, io_backup_session::read_thread_info, rv, fileio_backup_db_buffer::vdes, io_backup_session::verbose_fp, fileio_backup_file_header::vlabel, fileio_backup_db_buffer::vlabel, fileio_backup_file_header::volid, fileio_backup_db_buffer::volid, fileio_backup_buffer::voltotalio, xdisk_get_total_numpages(), and fileio_backup_header::zip_method.

Referenced by logpb_backup(), logpb_backup_for_volume(), and logpb_fatal_error_internal().

Here is the caller graph for this function:

int fileio_clear_backup_info_level ( int  level,
bool  dealloc,
int  which_bkvinf 
)
int fileio_copy_volume ( THREAD_ENTRY thread_p,
int  from_vdes,
DKNPAGES  npages,
const char *  to_vlabel,
VOLID  to_volid,
bool  reset_recvinfo 
)
void fileio_dismount_without_fsync ( THREAD_ENTRY thread_p,
int  vdes 
)
void fileio_finalize_backup_info ( int  which_bkvinf)
int fileio_finish_restore ( THREAD_ENTRY thread_p,
FILEIO_BACKUP_SESSION session 
)

Definition at line 9683 of file file_io.c.

References fileio_abort_restore(), fileio_synchronize_all(), and success().

Referenced by fileio_list_restore(), and logpb_restore().

Here is the caller graph for this function:

void fileio_flush_control_finalize ( void  )

Definition at line 702 of file file_io.c.

References assert, fc_Token_bucket, NULL, pthread_mutex_destroy, token_bucket::token_mutex, and token_bucket::waiter_cond.

Referenced by pgbuf_get_page_flush_interval().

Here is the caller graph for this function:

const char* fileio_get_backup_info_volume_name ( FILEIO_BACKUP_LEVEL  level,
int  unit_num,
int  which_bkvinf 
)
int fileio_get_max_name ( const char *  path,
long int *  filename_max,
long int *  pathname_max 
)

Definition at line 5459 of file file_io.c.

References fileio_get_primitive_way_max(), NULL, and strncpy_bufsize.

Referenced by logpb_verify_length().

Here is the caller graph for this function:

DKNPAGES fileio_get_number_of_volume_pages ( int  vdes,
size_t  page_size 
)

Definition at line 4918 of file file_io.c.

References page_size.

Referenced by dwb_check_data_page_is_sane(), dwb_load_and_recover_pages(), and log_get_num_pages_for_creation().

Here is the caller graph for this function:

STATIC_INLINE FILEIO_PAGE_WATERMARK* fileio_get_page_watermark_pos ( FILEIO_PAGE io_page,
PGLENGTH  page_size 
)

Definition at line 202 of file file_io.h.

References STATIC_INLINE.

Referenced by fileio_init_lsa_of_page(), fileio_is_page_sane(), fileio_reset_page_lsa(), fileio_set_page_lsa(), and pgbuf_init_temp_page_lsa().

Here is the caller graph for this function:

int fileio_get_volume_max_suffix ( void  )

Definition at line 5604 of file file_io.c.

References FILEIO_MAX_SUFFIX_LENGTH.

Referenced by logpb_verify_length().

Here is the caller graph for this function:

FILEIO_BACKUP_SESSION* fileio_initialize_backup ( const char *  db_fullname,
const char *  backup_destination,
FILEIO_BACKUP_SESSION session,
FILEIO_BACKUP_LEVEL  level,
const char *  verbose_file_path,
int  num_threads,
int  sleep_msecs 
)

Definition at line 6729 of file file_io.c.

References fileio_backup_buffer::alltotalio, fileio_backup_db_buffer::area, ARG_FILE_LINE, fileio_backup_header::bk_hdr_version, io_backup_session::bkup, fileio_backup_header::bkup_iosize, fileio_backup_buffer::bkuphdr, fileio_backup_buffer::buffer, fileio_backup_buffer::count, fileio_backup_buffer::current_path, DB_INT32_MAX, fileio_backup_header::db_next_bkvolname, fileio_backup_header::db_prec_bkvolname, io_backup_session::dbfile, fileio_backup_buffer::dtype, fileio_backup_header::end_time, ER_ERROR_SEVERITY, ER_IO_CANNOT_OPEN_VERBOSE_FILE, ER_IO_MOUNT_FAIL, er_log_debug, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), er_set_with_oserror(), error(), FILEIO_BACKUP_CURRENT_HEADER_VERSION, FILEIO_BACKUP_FILE_HEADER_PAGE_SIZE, FILEIO_BACKUP_FULL_LEVEL, FILEIO_BACKUP_HEADER_IO_SIZE, FILEIO_BACKUP_PAGE_OVERHEAD, FILEIO_BACKUP_VOL_DEVICE, FILEIO_BACKUP_VOL_DIRECTORY, FILEIO_BACKUP_VOL_UNKNOWN, FILEIO_BACKUP_WRITE, fileio_close(), FILEIO_DISK_FORMAT_MODE, FILEIO_DISK_PROTECTION_MODE, FILEIO_FULL_LEVEL_EXP, fileio_get_base_file_name(), fileio_get_directory_path(), FILEIO_INITIAL_BACKUP_UNITS, fileio_initialize_backup_thread(), fileio_make_backup_name(), fileio_open(), FILEIO_SET_BACKUP_PAGE_ID, FILEIO_ZIP_NONE_LEVEL, FILEIO_ZIP_NONE_METHOD, free_and_init, IO_PAGESIZE, fileio_backup_buffer::iosize, fileio_backup_header::level, fileio_backup_db_buffer::level, fileio_backup_db_buffer::lsa, LSA_SET_NULL(), fileio_backup_buffer::name, fileio_backup_db_buffer::nbytes, NO_ERROR, NULL, NULL_PAGEID, NULL_VOLDES, NULL_VOLID, prm_get_bigint_value(), prm_get_integer_value(), PRM_ID_IO_BACKUP_MAX_VOLUME_SIZE, PRM_ID_IO_BACKUP_NBUFFERS, fileio_backup_buffer::ptr, io_backup_session::sleep_msecs, fileio_backup_header::start_time, strncpy_bufsize, io_backup_session::type, fileio_backup_header::unit_num, fileio_backup_buffer::vdes, fileio_backup_db_buffer::vdes, io_backup_session::verbose_fp, fileio_backup_buffer::vlabel, fileio_backup_db_buffer::vlabel, fileio_backup_db_buffer::volid, fileio_backup_buffer::voltotalio, fileio_backup_header::zip_level, and fileio_backup_header::zip_method.

Referenced by fileio_initialize_restore(), and logpb_backup().

Here is the caller graph for this function:

void* fileio_initialize_pages ( THREAD_ENTRY thread_p,
int  vdes,
FILEIO_PAGE io_pgptr,
DKNPAGES  start_pageid,
DKNPAGES  npages,
size_t  page_size,
int  kbytes_to_be_written_per_sec 
)
bool fileio_is_formatted_page ( THREAD_ENTRY thread_p,
const char *  io_page 
)
STATIC_INLINE int fileio_is_page_sane ( FILEIO_PAGE io_page,
PGLENGTH  page_size 
)

Definition at line 237 of file file_io.h.

References fileio_get_page_watermark_pos(), fileio_page_reserved::lsa, fileio_page_watermark::lsa, LSA_EQ(), and fileio_page::prv.

Referenced by dwb_set_slot_data(), and fileio_page_check_corruption().

Here is the caller graph for this function:

bool fileio_is_permanent_volume_descriptor ( THREAD_ENTRY thread_p,
int  vol_fd 
)
bool fileio_is_volume_exist_and_file ( const char *  vlabel)

Definition at line 5132 of file file_io.c.

References fileio_find_volume_descriptor_with_label(), and NULL_VOLDES.

Referenced by fileio_abort_backup(), fileio_remove_all_backup(), and logpb_backup().

Here is the caller graph for this function:

int fileio_list_restore ( THREAD_ENTRY thread_p,
const char *  db_fullname,
char *  backup_source,
FILEIO_BACKUP_LEVEL  level,
bool  newvolpath 
)

Definition at line 9703 of file file_io.c.

References fileio_backup_db_buffer::area, ARG_FILE_LINE, fileio_backup_record_info::at_time, fileio_backup_header::bkpagesize, io_backup_session::bkup, fileio_backup_buffer::bkuphdr, CEIL_PTVDIV, fileio_backup_header::chkpt_lsa, CTIME_MAX, fileio_backup_header::db_compatibility, fileio_backup_header::db_creation, fileio_backup_header::db_fullname, fileio_backup_header::db_iopagesize, fileio_backup_header::db_next_bkvolname, fileio_backup_header::db_prec_bkvolname, fileio_backup_header::db_release, io_backup_session::dbfile, er_errid(), ER_ERROR_SEVERITY, ER_FAILED, ER_FATAL_ERROR_SEVERITY, ER_GENERIC_ERROR, ER_IO_BKUP_DATABASE_VOLUME_OR_FILE_EXPECTED, ER_IO_NOT_A_BACKUP, ER_IO_RESTORE_READ_ERROR, ER_LOG_CANNOT_ACCESS_BACKUP, er_set(), error(), fileio_abort_restore(), FILEIO_BACKUP_END_PAGE_ID, FILEIO_BACKUP_FILE_HEADER_PAGE_SIZE, FILEIO_BACKUP_FILE_START_PAGE_ID, FILEIO_BACKUP_FULL_LEVEL, FILEIO_BACKUP_START_PAGE_ID, FILEIO_BACKUP_UNDEFINED_LEVEL, FILEIO_BACKUP_VOL_CONT_PAGE_ID, fileio_finish_restore(), fileio_get_backup_level_string(), FILEIO_GET_BACKUP_PAGE_ID, fileio_get_zip_level_string(), fileio_get_zip_method_string(), FILEIO_INITIAL_BACKUP_UNITS, fileio_read_restore(), fileio_skip_restore_volume(), fileio_start_restore(), i, IO_PAGESIZE, fileio_backup_page::iopage, fileio_backup_header::iopageid, fileio_backup_header::level, fileio_backup_record_info::lsa, MSGCAT_CATALOG_CUBRID, MSGCAT_FILEIO_BKUP_FILE, MSGCAT_FILEIO_BKUP_HDR, MSGCAT_FILEIO_BKUP_HDR_BKUP_PAGESIZE, MSGCAT_FILEIO_BKUP_HDR_DBINFO, MSGCAT_FILEIO_BKUP_HDR_INC_ACTIVELOG, MSGCAT_FILEIO_BKUP_HDR_LEVEL, MSGCAT_FILEIO_BKUP_HDR_LX_LSA, MSGCAT_FILEIO_BKUP_HDR_RELEASES, MSGCAT_FILEIO_BKUP_HDR_TIME, MSGCAT_FILEIO_BKUP_HDR_ZIP_INFO, MSGCAT_FILEIO_BKUP_NEXT_BKVOL, MSGCAT_FILEIO_BKUP_PREV_BKVOL, msgcat_message(), MSGCAT_SET_IO, fileio_backup_file_header::nbytes, fileio_backup_db_buffer::nbytes, NO_ERROR, NULL, log_lsa::offset, log_lsa::pageid, fileio_backup_header::previnfo, fileio_backup_header::skip_activelog, fileio_backup_header::start_lsa, fileio_backup_header::start_time, strlen, fileio_backup_header::unit_num, fileio_backup_buffer::vlabel, fileio_backup_file_header::vlabel, fileio_backup_db_buffer::vlabel, fileio_backup_file_header::volid, fileio_backup_db_buffer::volid, fileio_backup_header::zip_level, and fileio_backup_header::zip_method.

Referenced by print_backup_info().

Here is the caller graph for this function:

FILEIO_LOCKF_TYPE fileio_lock_la_log_path ( const char *  db_fullname,
const char *  lock_path,
int  vdes,
int *  last_deleted_arv_num 
)
void fileio_make_backup_name ( char *  backup_name,
const char *  nopath_volname,
const char *  backup_path,
FILEIO_BACKUP_LEVEL  level,
int  unit_num 
)

Definition at line 5853 of file file_io.c.

References FILEIO_SUFFIX_BACKUP, and PATH_SEPARATOR.

Referenced by fileio_continue_restore(), fileio_get_backup_volume(), fileio_get_next_backup_volume(), fileio_initialize_backup(), logpb_backup(), and logpb_restore().

Here is the caller graph for this function:

void fileio_make_backup_volume_info_name ( char *  backup_volinfo_name,
const char *  backinfo_path,
const char *  dbname 
)
void fileio_make_dwb_name ( char *  dwb_name_p,
const char *  dwb_path_p,
const char *  db_name_p 
)

Definition at line 5881 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_DWB.

Referenced by dwb_create(), dwb_load_and_recover_pages(), and logpb_delete().

Here is the caller graph for this function:

void fileio_make_keys_name ( char *  keys_name_p,
const char *  db_name_p 
)

Definition at line 5897 of file file_io.c.

References FILEIO_SUFFIX_KEYS.

Referenced by tde_make_keys_file_fullname().

Here is the caller graph for this function:

void fileio_make_keys_name_given_path ( char *  keys_name_p,
const char *  keys_path_p,
const char *  db_name_p 
)

Definition at line 5914 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_KEYS.

Referenced by tde_make_keys_file_fullname().

Here is the caller graph for this function:

void fileio_make_log_active_name ( char *  logactive_name,
const char *  log_path,
const char *  dbname 
)

Definition at line 5707 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_LOGACTIVE.

Referenced by la_find_log_pagesize(), la_log_page_check(), logpb_copy_database(), logpb_initialize_log_names(), and logpb_rename_all_volumes_files().

Here is the caller graph for this function:

void fileio_make_log_archive_temp_name ( char *  log_archive_temp_name_p,
const char *  log_path_p,
const char *  db_name_p 
)

Definition at line 5793 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_TMP_LOGARCHIVE.

Referenced by logpb_initialize_log_names().

Here is the caller graph for this function:

void fileio_make_log_info_name ( char *  loginfo_name,
const char *  log_path,
const char *  dbname 
)

Definition at line 5815 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_LOGINFO.

Referenced by la_apply_log_file(), logpb_copy_database(), logpb_initialize_log_names(), and logpb_rename_all_volumes_files().

Here is the caller graph for this function:

void fileio_make_removed_log_archive_name ( char *  logarchive_name,
const char *  log_path,
const char *  dbname 
)

Definition at line 5777 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_SUFFIX_LOGARCHIVE.

Referenced by logpb_initialize_log_names().

Here is the caller graph for this function:

void fileio_make_temp_log_files_from_backup ( char *  temp_log_name,
VOLID  volid,
FILEIO_BACKUP_LEVEL  level,
const char *  base_log_name 
)

Definition at line 5726 of file file_io.c.

References LOG_DBLOG_ACTIVE_VOLID, LOG_DBLOG_ARCHIVE_VOLID, and LOG_DBLOG_INFO_VOLID.

Referenced by logpb_restore().

Here is the caller graph for this function:

void fileio_make_volume_ext_given_name ( char *  volext_fullname,
const char *  ext_path,
const char *  ext_name 
)

Definition at line 5672 of file file_io.c.

References FILEIO_PATH_SEPARATOR.

Referenced by boot_get_new_volume_name_and_id().

Here is the caller graph for this function:

void fileio_make_volume_ext_name ( char *  volext_fullname,
const char *  ext_path,
const char *  ext_name,
VOLID  volid 
)

Definition at line 5654 of file file_io.c.

References FILEIO_PATH_SEPARATOR, and FILEIO_VOLEXT_PREFIX.

Referenced by boot_get_new_volume_name_and_id(), disk_add_volume(), log_recovery_notpartof_volumes(), and logpb_next_where_path().

Here is the caller graph for this function:

void fileio_make_volume_info_name ( char *  volinfo_name,
const char *  db_fullname 
)
void fileio_make_volume_temp_name ( char *  voltmp_fullname,
const char *  tmp_path,
const char *  tmp_name,
VOLID  volid 
)

Definition at line 5690 of file file_io.c.

References FILEIO_VOLTMP_PREFIX, and PATH_SEPARATOR.

Referenced by boot_find_rest_temp_volumes(), boot_get_new_volume_name_and_id(), and boot_make_temp_volume_fullname().

Here is the caller graph for this function:

bool fileio_map_mounted ( THREAD_ENTRY thread_p,
bool(*)(THREAD_ENTRY *thread_p, VOLID volid, void *args)  fun,
void *  args 
)
FILEIO_RESTORE_PAGE_BITMAP* fileio_page_bitmap_create ( int  vol_id,
int  total_pages 
)

Definition at line 11615 of file file_io.c.

References ARG_FILE_LINE, page_bitmap::bitmap, CEIL_PTVDIV, ER_ERROR_SEVERITY, ER_OUT_OF_VIRTUAL_MEMORY, er_set(), free_and_init, page_bitmap::next, NULL, page_bitmap::size, and page_bitmap::vol_id.

Referenced by logpb_restore().

Here is the caller graph for this function:

void fileio_page_bitmap_list_add ( FILEIO_RESTORE_PAGE_BITMAP_LIST page_bitmap_list,
FILEIO_RESTORE_PAGE_BITMAP page_bitmap 
)

Definition at line 11684 of file file_io.c.

References assert, page_bitmap_list::head, page_bitmap::next, NULL, page_bitmap_list::tail, and page_bitmap::vol_id.

Referenced by logpb_restore().

Here is the caller graph for this function:

void fileio_page_bitmap_list_destroy ( FILEIO_RESTORE_PAGE_BITMAP_LIST page_bitmap_list)

Definition at line 11726 of file file_io.c.

References assert, page_bitmap::bitmap, free_and_init, page_bitmap_list::head, page_bitmap::next, NULL, page_bitmap::size, page_bitmap_list::tail, and page_bitmap::vol_id.

Referenced by logpb_restore().

Here is the caller graph for this function:

FILEIO_RESTORE_PAGE_BITMAP* fileio_page_bitmap_list_find ( FILEIO_RESTORE_PAGE_BITMAP_LIST page_bitmap_list,
int  vol_id 
)

Definition at line 11653 of file file_io.c.

References assert, page_bitmap_list::head, page_bitmap::next, NULL, page_bitmap_list::tail, and page_bitmap::vol_id.

Referenced by logpb_restore().

Here is the caller graph for this function:

void fileio_page_bitmap_list_init ( FILEIO_RESTORE_PAGE_BITMAP_LIST page_bitmap_list)

Definition at line 11601 of file file_io.c.

References assert, page_bitmap_list::head, NULL, and page_bitmap_list::tail.

Referenced by logpb_restore().

Here is the caller graph for this function:

int fileio_page_check_corruption ( THREAD_ENTRY thread_p,
FILEIO_PAGE io_page,
bool is_page_corrupted 
)

Definition at line 11831 of file file_io.c.

References assert, fileio_is_page_sane(), IO_PAGESIZE, NO_ERROR, and NULL.

Referenced by dwb_check_data_page_is_sane(), dwb_debug_check_dwb(), pgbuf_check_bcb_page_vpid(), and pwrite_with_injected_fault().

Here is the caller graph for this function:

void fileio_page_hexa_dump ( const char *  data,
int  length 
)

Definition at line 3597 of file file_io.c.

References ARG_FILE_LINE, assert, er_log_debug, free_and_init, i, and NULL.

Referenced by log_recovery_analysis(), and pwrite_with_injected_fault().

Here is the caller graph for this function:

const char* fileio_rename ( VOLID  volid,
const char *  old_vlabel,
const char *  new_vlabel 
)
STATIC_INLINE void fileio_reset_page_lsa ( FILEIO_PAGE io_page,
PGLENGTH  page_size 
)

Definition at line 217 of file file_io.h.

References fileio_get_page_watermark_pos(), fileio_page_reserved::lsa, fileio_page_watermark::lsa, LSA_SET_NULL(), fileio_page::prv, and STATIC_INLINE.

Referenced by fileio_copy_volume().

Here is the caller graph for this function:

int fileio_reset_volume ( THREAD_ENTRY thread_p,
int  vdes,
const char *  vlabel,
DKNPAGES  npages,
const LOG_LSA reset_lsa 
)
int fileio_restore_volume ( THREAD_ENTRY thread_p,
FILEIO_BACKUP_SESSION session,
char *  to_vlabel,
char *  verbose_to_vlabel,
char *  prev_vlabel,
FILEIO_RESTORE_PAGE_BITMAP page_bitmap,
bool  remember_pages 
)

Definition at line 10235 of file file_io.c.

References fileio_backup_db_buffer::area, ARG_FILE_LINE, fileio_backup_header::bkpagesize, io_backup_session::bkup, fileio_backup_buffer::bkuphdr, CEIL_PTVDIV, fileio_backup_header::db_creation, io_backup_session::dbfile, DISK_FLUSH_AND_INVALIDATE, disk_set_creation(), disk_set_link(), DISK_VOLHEADER_PAGE, ER_ERROR_SEVERITY, ER_FAILED, ER_IO_RESTORE_PAGEID_OUTOF_BOUNDS, ER_IO_RESTORE_READ_ERROR, er_set(), error(), FILEIO_BACKUP_FILE_END_PAGE_ID, FILEIO_BACKUP_FULL_LEVEL, FILEIO_CHECK_RESTORE_PAGE_ID, fileio_decompress_restore_volume(), fileio_dismount(), fileio_fill_hole_during_restore(), fileio_find_previous_perm_volume(), fileio_format(), FILEIO_GET_BACKUP_PAGE_ID, fileio_get_base_file_name(), fileio_is_volume_exist(), fileio_mount(), fileio_page_bitmap_dump(), FILEIO_RESTORE_DBVOLS_IO_PAGE_SIZE, fileio_write_restore(), for(), i, IO_PAGESIZE, fileio_backup_page::iopage, fileio_backup_page::iopageid, fileio_backup_buffer::last_chkpt_lsa, fileio_backup_db_buffer::level, fileio_backup_buffer::loc_db_fullname, LOG_DBFIRST_VOLID, MSGCAT_CATALOG_CUBRID, MSGCAT_FILEIO_BKUP_FILE, msgcat_message(), MSGCAT_SET_IO, fileio_backup_file_header::nbytes, fileio_backup_db_buffer::nbytes, NO_ERROR, NULL, NULL_VOLDES, NULL_VOLID, fileio_backup_header::unit_num, fileio_backup_db_buffer::vdes, io_backup_session::verbose_fp, fileio_backup_db_buffer::vlabel, fileio_backup_file_header::volid, and fileio_backup_db_buffer::volid.

Referenced by logpb_restore().

Here is the caller graph for this function:

int fileio_set_page_checksum ( THREAD_ENTRY thread_p,
FILEIO_PAGE io_page 
)
STATIC_INLINE void fileio_set_page_lsa ( FILEIO_PAGE io_page,
const LOG_LSA lsa,
PGLENGTH  page_size 
)

Definition at line 227 of file file_io.h.

References fileio_get_page_watermark_pos(), fileio_page_reserved::lsa, fileio_page_watermark::lsa, LSA_COPY(), fileio_page::prv, and STATIC_INLINE.

Referenced by fileio_reset_volume(), and pgbuf_set_lsa().

Here is the caller graph for this function:

int fileio_set_permission ( const char *  vlabel)

Definition at line 2002 of file file_io.c.

References ARG_FILE_LINE, ER_ERROR_SEVERITY, ER_IO_CANNOT_CHANGE_PERMISSION, ER_IO_CANNOT_GET_PERMISSION, er_set_with_oserror(), error(), mode, and NO_ERROR.

Referenced by fileio_mount().

Here is the caller graph for this function:

FILEIO_BACKUP_SESSION* fileio_start_backup ( THREAD_ENTRY thread_p,
const char *  db_fullname,
INT64 *  db_creation,
FILEIO_BACKUP_LEVEL  backup_level,
LOG_LSA backup_start_lsa,
LOG_LSA backup_ckpt_lsa,
FILEIO_BACKUP_RECORD_INFO all_levels_info,
FILEIO_BACKUP_SESSION session,
FILEIO_ZIP_METHOD  zip_method,
FILEIO_ZIP_LEVEL  zip_level 
)

Definition at line 7155 of file file_io.c.

References fileio_backup_record_info::at_time, fileio_backup_header::bkpagesize, io_backup_session::bkup, fileio_backup_buffer::bkuphdr, fileio_backup_header::chkpt_lsa, CUBRID_MAGIC_DATABASE_BACKUP, CUBRID_MAGIC_MAX_LENGTH, fileio_backup_header::db_compatibility, fileio_backup_header::db_creation, fileio_backup_header::db_fullname, fileio_backup_header::db_iopagesize, fileio_backup_header::db_release, io_backup_session::dbfile, error(), fileio_abort_backup(), fileio_add_volume_to_backup_info(), FILEIO_BACKUP_FULL_LEVEL, FILEIO_BACKUP_MINIMUM_NUM_PAGES, FILEIO_BACKUP_MINIMUM_NUM_PAGES_FULL_LEVEL, FILEIO_BACKUP_START_PAGE_ID, FILEIO_BACKUP_UNDEFINED_LEVEL, fileio_create_backup_volume(), FILEIO_DBVOLS_IO_PAGE_SIZE, FILEIO_FIRST_BACKUP_VOL_INFO, FILEIO_FULL_LEVEL_EXP, FILEIO_INITIAL_BACKUP_UNITS, fileio_write_backup_header(), FILEIO_ZIP_LZ4_METHOD, i, IO_PAGESIZE, fileio_backup_header::iopageid, fileio_backup_header::level, fileio_backup_db_buffer::level, LOG_DBCOPY_VOLID, fileio_backup_record_info::lsa, fileio_backup_db_buffer::lsa, LSA_COPY(), LSA_SET_NULL(), fileio_backup_header::magic, fileio_backup_buffer::name, NO_ERROR, NULL, NULL_VOLDES, fileio_backup_header::previnfo, rel_disk_compatible(), rel_release_string(), fileio_backup_header::start_lsa, fileio_backup_header::start_time, strncpy_bufsize, fileio_backup_header::unit_num, fileio_backup_buffer::vdes, fileio_backup_buffer::vlabel, fileio_backup_header::zip_level, and fileio_backup_header::zip_method.

Referenced by logpb_backup().

Here is the caller graph for this function:

FILEIO_BACKUP_SESSION* fileio_start_restore ( THREAD_ENTRY thread_p,
const char *  db_fullname,
char *  backup_source,
INT64  match_dbcreation,
PGLENGTH db_iopagesize,
float *  db_compatibility,
FILEIO_BACKUP_SESSION session,
FILEIO_BACKUP_LEVEL  level,
bool  authenticate,
INT64  match_bkupcreation,
const char *  restore_verbose_file_path,
bool  newvolpath 
)
int fileio_symlink ( const char *  src,
const char *  dest,
int  overwrite 
)

Definition at line 11503 of file file_io.c.

References ARG_FILE_LINE, ER_BO_CANNOT_CREATE_LINK, ER_ERROR_SEVERITY, ER_FAILED, er_set(), fileio_is_volume_exist(), and NO_ERROR.

Referenced by logpb_next_where_path().

Here is the caller graph for this function:

FILEIO_LOCKF_TYPE fileio_unlock_la_dbname ( int *  lockf_vdes,
char *  db_name,
bool  clear_owner 
)
int fileio_write_backup_info_entries ( FILE *  fp,
int  which_bkvinf 
)
void* fileio_writev ( THREAD_ENTRY thread_p,
int  vdes,
void **  arrayof_io_pgptr,
PAGEID  start_pageid,
DKNPAGES  npages,
size_t  page_size 
)