MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / mvol_init_write

Function mvol_init_write

src/burp/mvol.cpp:794–830  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

792}
793
794void mvol_init_write(BurpGlobals* tdgbl, const char* file_name, int* cnt, UCHAR** ptr)
795{
796 tdgbl->mvol_volume_count = 1;
797 tdgbl->mvol_empty_file = true;
798
799 if (file_name != NULL)
800 {
801 strncpy(tdgbl->mvol_old_file, file_name, MAX_FILE_NAME_SIZE);
802 tdgbl->mvol_old_file[MAX_FILE_NAME_SIZE - 1] = 0;
803 }
804 else
805 {
806 tdgbl->mvol_old_file[0] = 0;
807 }
808
809 tdgbl->mvol_actual_buffer_size = tdgbl->mvol_io_buffer_size;
810 const ULONG temp_buffer_size = tdgbl->mvol_io_buffer_size * tdgbl->gbl_sw_blk_factor;
811 tdgbl->mvol_io_memory = BURP_alloc(temp_buffer_size + MAX_HEADER_SIZE * 2);
812 tdgbl->mvol_io_ptr = tdgbl->mvol_io_buffer =
813 (UCHAR*) FB_ALIGN((U_IPTR) tdgbl->mvol_io_memory, MAX_HEADER_SIZE);
814 tdgbl->mvol_io_cnt = tdgbl->mvol_actual_buffer_size;
815
816 while (!write_header(tdgbl->file_desc, temp_buffer_size, false))
817 {
818 if (tdgbl->action->act_action == ACT_backup_split)
819 {
820 BURP_error(269, true, tdgbl->action->act_file->fil_name.c_str());
821 // msg 269 can't write a header record to file %s
822 }
823 tdgbl->file_desc = next_volume(tdgbl->file_desc, MODE_WRITE, false);
824 }
825
826 tdgbl->mvol_actual_buffer_size = temp_buffer_size;
827
828 *cnt = tdgbl->mvol_io_cnt;
829 *ptr = tdgbl->mvol_io_ptr;
830}
831
832
833//____________________________________________________________

Callers 1

MVOL_init_writeFunction · 0.85

Calls 5

BURP_allocFunction · 0.85
FB_ALIGNFunction · 0.85
BURP_errorFunction · 0.85
write_headerFunction · 0.70
c_strMethod · 0.45

Tested by

no test coverage detected